[LLVMbugs] [Bug 10273] New: clang++ asserts when including Boost.Spirit header

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jul 4 21:58:54 PDT 2011


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

           Summary: clang++ asserts when including Boost.Spirit header
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tziltzal at y7mail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


compiling:

#include <boost/spirit/include/qi.hpp>

int main() { } 

by issuing:

/usr/local/bin/clang++     -o CMakeFiles/test.dir/test.cpp.o -c
/home/user/Sources/test/test.cpp (through cmake finding boost 1.44)

produced:

clang: /usr/src/llvm/tools/clang/lib/AST/Decl.cpp:1683: void
clang::FunctionDecl::setParams(clang::ASTContext&, clang::ParmVarDecl**,
unsigned int): Assertion `NumParams == getNumParams() && "Parameter count
mismatch!"' failed.
0  clang           0x0000000001bc97ff
1  clang           0x0000000001bca33a
2  libpthread.so.0 0x000000370780eeb0
3  libc.so.6       0x0000003706c330c5 gsignal + 53
4  libc.so.6       0x0000003706c34a76 abort + 390
5  libc.so.6       0x0000003706c2b905 __assert_fail + 245                       
6  clang           0x0000000000f39acc                                           
7  clang           0x0000000000bfcce4
clang::TemplateDeclInstantiator::VisitFunctionDecl(clang::FunctionDecl*,
clang::TemplateParameterList*) + 1076                                           
8  clang           0x0000000000bfbfad clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 125        
9  clang           0x0000000000bc9d1c
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*) + 2636              
10 clang           0x0000000000bcb589
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::Expr**, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&) + 1065   
11 clang           0x0000000000b369a9
clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*,
clang::DeclAccessPair, clang::TemplateArgumentListInfo*, clang::Expr**,
unsigned int, clang::OverloadCandidateSet&, bool) + 393
12 clang           0x0000000000b4295b
clang::Sema::AddOverloadedCallCandidates(clang::UnresolvedLookupExpr*,
clang::Expr**, unsigned int, clang::OverloadCandidateSet&, bool) + 219          
13 clang           0x0000000000b42c20
clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*,
clang::UnresolvedLookupExpr*, clang::SourceLocation, clang::Expr**, unsigned
int, clang::SourceLocation, clang::Expr*) + 208         
14 clang           0x0000000000abd87a clang::Sema::ActOnCallExpr(clang::Scope*,
clang::Expr*, clang::SourceLocation, clang::ASTMultiPtr<clang::Expr*>,
clang::SourceLocation, clang::Expr*) + 778                                      
15 clang           0x00000000009744bc
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) + 2332                                                                   
16 clang           0x000000000096e75b clang::Parser::ParseCastExpression(bool,
bool, bool&, bool) + 203                                                        
17 clang           0x0000000000970bfe clang::Parser::ParseCastExpression(bool,
bool, bool) + 46                                                                
18 clang           0x000000000096fb81 clang::Parser::ParseCastExpression(bool,
bool, bool&, bool) + 5361                                                       
19 clang           0x0000000000970bfe clang::Parser::ParseCastExpression(bool,
bool, bool) + 46                                                                
20 clang           0x00000000009716a2
clang::Parser::ParseAssignmentExpression() + 34                                 
21 clang           0x0000000000972389 clang::Parser::ParseExpression() + 9      
22 clang           0x0000000000970fb2
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 882                                                
23 clang           0x00000000009716b2
clang::Parser::ParseAssignmentExpression() + 50                                 
24 clang           0x0000000000972389 clang::Parser::ParseExpression() + 9      
25 clang           0x00000000009288b0
clang::Parser::ParseReturnStatement(clang::ParsedAttributes&) + 176             
26 clang           0x000000000092d9e8
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 520                                                              
27 clang           0x000000000092b2fa
clang::Parser::ParseCompoundStatementBody(bool) + 1626
28 clang           0x000000000092baa5
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 149
29 clang           0x00000000009479b3
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 2067
30 clang           0x0000000000954f30
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*, clang::Parser::ForRangeInit*) + 1472
31 clang           0x00000000009424f1
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 145
32 clang           0x0000000000942ae3
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 531
33 clang           0x0000000000944e90
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 3184
34 clang           0x00000000009660d9
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::SourceLocation&) + 377
35 clang           0x000000000096c116 clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3734
36 clang           0x000000000095aa77
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 567
37 clang           0x0000000000944480
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 608
38 clang           0x00000000009660d9
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::SourceLocation&) + 377
39 clang           0x000000000096c116 clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3734
40 clang           0x000000000095aa77
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 567
41 clang           0x0000000000944480
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 608
42 clang           0x00000000009660d9
clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*,
std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation,
std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::SourceLocation&) + 377
43 clang           0x000000000096c116 clang::Parser::ParseNamespace(unsigned
int, clang::SourceLocation&, clang::SourceLocation) + 3734
44 clang           0x000000000095aa77
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 567
45 clang           0x0000000000944480
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 608
46 clang           0x000000000094515c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 156
47 clang           0x000000000091a51d clang::ParseAST(clang::Sema&, bool) + 189
48 clang           0x00000000007bacd4 clang::CodeGenAction::ExecuteAction() +
68
49 clang           0x00000000006b0653
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 371
50 clang           0x0000000000688bcd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1181
51 clang           0x000000000067d66b cc1_main(char const**, char const**, char
const*, void*) + 779
52 clang           0x0000000000687b43 main + 7283
53 libc.so.6       0x0000003706c1ee5d __libc_start_main + 253
54 clang           0x000000000067d179
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
test.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.51.0.7 -momit-leaf-frame-pointer -coverage-file
CMakeFiles/test.dir/test.cpp.o -resource-dir /usr/local/bin/../lib/clang/3.0
-fdeprecated-macro -ferror-limit 19 -fmessage-length 237 -fgnu-runtime
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
CMakeFiles/test.dir/test.cpp.o -x c++ /home/user/Sources/test/test.cpp 
1.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:82:50:
current parser token ')'
2.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:31:1:
parsing namespace 'boost'
3.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:31:19:
parsing namespace 'spirit'
4.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:31:38:
parsing namespace 'traits'
5.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:81:5:
parsing function body 'negate'
6.      /usr/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp:81:5: in
compound statement ('{}')
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)


clang++ --version outputs:

clang version 3.0 (trunk 134402)
Target: x86_64-unknown-linux-gnu
Thread model: posix

llvm & clang were compiled together with --enabled-optimize.

uname -a outputs:

Linux fedora-host 2.6.35.13-92.fc14.x86_64 #1 SMP Sat May 21 17:26:25 UTC 2011
x86_64 x86_64 x86_64 GNU/Linux

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