[LLVMbugs] [Bug 7180] New: Crash on invalid - using undefined namespaces

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 20 04:00:32 PDT 2010


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

           Summary: Crash on invalid - using undefined namespaces
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: chris at bubblescope.net
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


The following function prototype crashes clang. Such code is easy to generate
if headers for libraries are not included.

void f( a::b::c );

backtrace:

$ clang++ t.cc -c
t.cc:1:8: error: use of undeclared identifier 'a'
void f(a::b::c);
       ^
Assertion failed: (CachedTokens[CachedLexPos-1].getLastLoc() ==
Tok.getAnnotationEndLoc() && "The annotation should be until the most recent
cached token"), function AnnotatePreviousCachedTokens, file PPCaching.cpp, line
95.
0  clang             0x0000000100ff23f8 PrintStackTrace(void*) + 38
1  clang             0x0000000100ff28d8 SignalHandler(int) + 312
2  libSystem.B.dylib 0x00007fff880a580a _sigtramp + 26
3  libSystem.B.dylib 0x00007fff8804a50a tiny_malloc_from_free_list + 1196
4  libSystem.B.dylib 0x00007fff88120ef0 __pthread_markcancel + 0
5  clang             0x000000010065e981
clang::Preprocessor::AnnotatePreviousCachedTokens(clang::Token const&) + 261
6  clang             0x000000010064b7bf
clang::Preprocessor::AnnotateCachedTokens(clang::Token const&) + 145
7  clang             0x0000000100645d6f
clang::Parser::TryAnnotateTypeOrScopeToken(bool) + 2521
8  clang             0x0000000100643344
clang::Parser::isCXXDeclarationSpecifier() + 882
9  clang             0x00000001006435f5
clang::Parser::TryParseDeclarationSpecifier() + 21
10 clang             0x0000000100643c38
clang::Parser::TryParseParameterDeclarationClause() + 100
11 clang             0x0000000100643f4e
clang::Parser::isCXXFunctionDeclarator(bool) + 68
12 clang             0x00000001006099e5
clang::Parser::ParseDirectDeclarator(clang::Declarator&) + 2123
13 clang             0x0000000100603c9e
clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void
(clang::Parser::*)(clang::Declarator&)) + 960
14 clang             0x0000000100604150
clang::Parser::ParseDeclarator(clang::Declarator&) + 56
15 clang             0x000000010060b340
clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int,
bool, clang::SourceLocation*) + 98
16 clang             0x00000001006466dd
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AttributeList*, clang::AccessSpecifier) + 1053
17 clang             0x0000000100646749
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::AttributeList*,
clang::AccessSpecifier) + 83
18 clang             0x0000000100648485
clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList) + 2211
19 clang             0x00000001006485c3
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<1>&) + 247
20 clang             0x000000010024d503 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer*) + 456
21 clang             0x0000000100067402
clang::ASTFrontendAction::ExecuteAction() + 256
22 clang             0x00000001000674ff clang::FrontendAction::Execute() + 239
23 clang             0x000000010004a17c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 784
24 clang             0x0000000100027b8a cc1_main(char const**, char const**,
char const*, void*) + 1761
25 clang             0x000000010002bec1 main + 252
26 clang             0x0000000100026a2c start + 52
27 clang             0x0000000000000020 start + 4294809128
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-apple-darwin10.0.0 -emit-obj -disable-free -main-file-name t.cc
-pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-resource-dir /usr/local/lib/clang/2.0 -ferror-limit 19 -fmessage-length 177
-stack-protector 1 -fblocks -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o t.o -x c++ t.cc 
1.    t.cc:1:8: at annotation token 
clang: error: assembler 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