http://llvm.org/bugs/show_bug.cgi?id=10115

           Summary: clang crashes on invalid code
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


When parsing the following invalid code

struct S {
  int m[];
  not_known foo();
  S() {}
};

clang crashes on an assertion producing the following:

$ Debug+Asserts/bin/clang++  -c bug.cc
bug.cc:3:3: error: unknown type name
      'not_known'
  not_known foo();
  ^
clang: SemaDeclCXX.cpp:2260: bool
clang::Sema::SetCtorInitializers(clang::CXXConstructorDecl*,
clang::CXXCtorInitializer**, unsigned int, bool): Assertion
`ClassDecl->hasFlexibleArrayMember() && "Incomplete array type is not valid"'
failed.

[...]

1.    bug.cc:4:7: current parser token '{'
2.    bug.cc:1:1: parsing struct/union/class body 'S'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)

Note that the assertion is not triggered if the method foo() is commented out.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to