[LLVMbugs] [Bug 6575] New: Clang fails to compile member initialiser for fields of nested anonymous structs and unions
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Mar 10 12:10:31 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=6575
Summary: Clang fails to compile member initialiser for fields
of nested anonymous structs and unions
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: oliver at apple.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Only fails with -Wall strangely, but here is the minimised case:
struct MyClass {
MyClass() : m_int(0) {}
union {
struct {
int m_int;
};
};
};
g++ -Wall ... is fine
clang++ -Wall ... produces:
Assertion failed: (PrevMember && "Member not in member list?!"), function
ActOnMemInitializers, file SemaDeclCXX.cpp, line 1812.
0 clang 0x00000001010413d2 PrintStackTrace(void*) + 34
1 clang 0x0000000101041c5c SignalHandler(int) + 652
2 libSystem.B.dylib 0x00007fff81febeaa _sigtramp + 26
3 libSystem.B.dylib 0xcac9f0b4e90ceeac _sigtramp + 1728983068
4 libSystem.B.dylib 0x00007fff82067e74 __pthread_markcancel + 0
5 clang 0x00000001002fcffe
clang::Sema::ActOnMemInitializers(clang::OpaquePtr<0>, clang::SourceLocation,
void**, unsigned int, bool) + 5022
6 clang 0x000000010062587b
clang::Parser::ParseConstructorInitializer(clang::OpaquePtr<0>) + 491
7 clang 0x000000010060cb1e
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 110
8 clang 0x0000000100626da9
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::OpaquePtr<0>) + 1433
9 clang 0x000000010062883c
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 5916
10 clang 0x0000000100618e11
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 3937
11 clang 0x0000000100666408
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AttributeList*, clang::AccessSpecifier) + 152
12 clang 0x000000010066684e
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::AttributeList*,
clang::AccessSpecifier) + 350
13 clang 0x000000010066691c
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 76
14 clang 0x0000000100667718
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 104
15 clang 0x00000001002799cb clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 251
16 clang 0x0000000100053bb9
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 393
17 clang 0x0000000100038850 cc1_main(char const**, char const**,
char const*, void*) + 2064
18 clang 0x000000010003b5b7 main + 2247
19 clang 0x0000000100036478 start + 52
20 clang 0x000000000000001e start + 4294745050
Stack dump:
0. Program arguments: /Users/oliver/llvm/llvm/Release/bin/clang -cc1 -triple
x86_64-apple-darwin10.0.0 -S -disable-free -main-file-name foo.cpp -pic-level 1
-mdisable-fp-elim -munwind-tables -target-cpu core2 -resource-dir
/Users/oliver/llvm/llvm/Release/lib/clang/1.1 -Wall -fmessage-length 132
-stack-protector 1 -fblocks -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o
/var/folders/3C/3CRLXCBPEeGMkdDv4V76e++++TI/-Tmp-/cc-kQdJL4.s -x c++ foo.cpp
1. foo.cpp:2:26: current parser token '{'
2. foo.cpp:1:1: parsing struct/union/class body 'MyClass'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
--
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.
More information about the llvm-bugs
mailing list