[LLVMbugs] [Bug 11842] New: assigment of enum value in struct with address space attribute causes assert

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 24 01:10:54 PST 2012


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

             Bug #: 11842
           Summary: assigment of enum value in struct with address space
                    attribute causes assert
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hkultala at cs.tut.fi
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7938
  --> http://llvm.org/bugs/attachment.cgi?id=7938
code causing the assert. compile with command: clang -cc1 -o foo.bc -x c++
foo.cc

A code with a struct that has an address space attribute containing an enum
causes an assertion when a value is assigned to the enum field in the struct.

This code works with clang 3.0, broken only with relatively new ToT/3.1svn.


compile with command:

clang -cc1 -o foo.bc -x c++ foo.cc



gives error:





clang: SemaOverload.cpp:9786: clang::ExprResult
clang::Sema::CreateOverloadedBinOp(clang::SourceLocation, unsigned int, const
clang::UnresolvedSetImpl&, clang::Expr*, clang::Expr*): Assertion
`Result.isInvalid() && "C++ binary operator overloading is missing
candidates!"' failed.
0  libLLVM-3.1svn.so 0x00007fc7e4ee45ef
1  libLLVM-3.1svn.so 0x00007fc7e4ee6862
2  libpthread.so.0   0x00007fc7e4103b40
3  libc.so.6         0x00007fc7e3401ba5 gsignal + 53
4  libc.so.6         0x00007fc7e34056b0 abort + 384
5  libc.so.6         0x00007fc7e33faa71 __assert_fail + 241
6  clang             0x0000000000a6f7ea
7  clang             0x000000000098088e
8  clang             0x00000000009a8d28 clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
520
9  clang             0x00000000009a8f76 clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 278
10 clang             0x00000000008568ed
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 701
11 clang             0x00000000008573ff
clang::Parser::ParseAssignmentExpression() + 47
12 clang             0x00000000008581c9 clang::Parser::ParseExpression() + 9
13 clang             0x00000000008173d3
clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 83
14 clang             0x00000000008157ab
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*) + 2331
15 clang             0x0000000000812e11
clang::Parser::ParseCompoundStatementBody(bool) + 1793
16 clang             0x0000000000813418
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 168
17 clang             0x0000000000828aa2
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 2210
18 clang             0x000000000083912b
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 3323
19 clang             0x0000000000825e8d
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 157
20 clang             0x00000000008263f6
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 742
21 clang             0x000000000082b47b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2283
22 clang             0x000000000084ccf0
clang::Parser::ParseLinkage(clang::Parser::ParsingDeclSpec&, unsigned int) +
1040
23 clang             0x0000000000825f88
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 408
24 clang             0x00000000008263f6
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 742
25 clang             0x000000000082b47b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2283
26 clang             0x000000000082b920
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 160
27 clang             0x0000000000802da5 clang::ParseAST(clang::Sema&, bool) +
293
28 clang             0x000000000054e2c1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 321
29 clang             0x00000000005373a9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1401
30 clang             0x000000000052d4a4 cc1_main(char const**, char const**,
char const*, void*) + 484
31 clang             0x0000000000536147 main + 6999
32 libc.so.6         0x00007fc7e33ecd8e __libc_start_main + 254
33 clang             0x000000000052afb9
Stack dump:
0.      Program arguments: clang -cc1 -o foo.bc -x c++ foo.cc 
1.      foo.cc:47:39: current parser token ';'
2.      foo.cc:46:37: parsing function body 'alloc_from_global_memory'
3.      foo.cc:46:37: in compound statement ('{}')
Aborted

-- 
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