[cfe-dev] Assertion Failure (!isIncompleteType() && "This doesn't make sense for incomplete types"); for int [] type

Jyoti jyoti.yalamanchili at gmail.com
Mon Oct 7 06:15:18 PDT 2013


I would like to add that, the assertion mentioned in the subject line
(isIncompleteTypes().. related ) could be reporduced with a debug build of
clang with following cmd line options
clang++ -std=c++0x variadic103.cpp

The second assertion related with isa_impl_cl occurs when clang is built
with the patch added as shown above in SemaTemplateInstantiateDecl.cpp.
The bugreport attached contains preprocessed source and script used to run
gtest-all.cc

Appreciate any inputs on this to proceed further.

Thanks !
- Jyoti


On Mon, Oct 7, 2013 at 6:35 PM, Jyoti <jyoti.yalamanchili at gmail.com> wrote:

> Hi All,
>
> I am trying to fix the above mentioned assertion for a failing gcc
> testcase.
> g++.dg/c++0x/variadic103.cpp testcase ( attached )
>
> Patch added is as follows in TemplateDeclInstantiator::VisitVarDecl
> function of  SemaTemplateInstantiateDecl.cpp
>
> For the above testcases an error should be thrown for incomplete types
> having an initializer with zero elements.
>
>
> if (!DI)
>     return 0;
>
> + Expr* Arg= D->getInit();
> +  InitListExpr *ILE = dyn_cast<InitListExpr>(Arg);
> +  if(!ILE || (ILE && ILE->getNumInits() == 0 )) {
> +    if (DI->getType()->isIncompleteType() ||
> DI->getType()->isIncompleteOrObjectType() ) {
> +      if (SemaRef.RequireCompleteType(D->getLocation(), DI->getType(),
> + diag::err_typecheck_incomplete_array_needs_initializer)) {
> +        D->setInvalidDecl();
> +       return 0;
> +      }
> +    }
> + }
>
>
> With above code, there is a diagnostic thrown for g++.dg/c++0x/variadic103.cpp
> testcase as expected and the "Assertion Failure (!isIncompleteType() &&
> "This doesn't make sense for incomplete types"); for int [] type " is
> resolved, however some other assertion in isa_impl_cl occurs while running
> clang regression on c++ googletests file ( gtest-all.cc )
>
> Appreciate any inputs on this for me to proceed further.
>
> Thanks.
> - Jyoti
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131007/65995210/attachment.html>


More information about the cfe-dev mailing list