[LLVMbugs] [Bug 9226] New: Invalid code leads to assertion "FIXME: Only type template names supported here"

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 15 09:52:59 PST 2011


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

           Summary: Invalid code leads to assertion "FIXME: Only type
                    template names supported here"
           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 invalid code snippet, derived from an invalid boost testcase:

template<typename a>
void nt()
{ nt<>:: }


Leads to the backtrace:

clang: ParseExprCXX.cpp:228: bool
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::ParsedType, bool, bool*): Assertion `false && "FIXME: Only type template
names supported here"' failed.
0  clang           0x000000000236eb71
1  clang           0x000000000236e964
2  libpthread.so.0 0x00007f23b0d608f0
3  libc.so.6       0x00007f23b004fa75 gsignal + 53
4  libc.so.6       0x00007f23b00535c0 abort + 384
5  libc.so.6       0x00007f23b0048941 __assert_fail + 241
6  clang           0x000000000129f634
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*) + 2312
7  clang           0x000000000127d120
clang::Parser::TryAnnotateTypeOrScopeToken(bool) + 1668
8  clang           0x0000000001276fdd
clang::Parser::isCXXDeclarationSpecifier() + 139
9  clang           0x0000000001275d8e clang::Parser::isCXXSimpleDeclaration() +
34
10 clang           0x0000000001275d69
clang::Parser::isCXXDeclarationStatement() + 85
11 clang           0x00000000012759a4 clang::Parser::isDeclarationStatement() +
52
12 clang           0x000000000126fe90
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 480
13 clang           0x0000000001271170
clang::Parser::ParseCompoundStatementBody(bool) + 306
14 clang           0x0000000001274a44
clang::Parser::ParseFunctionStatementBody(clang::Decl*) + 220
15 clang           0x000000000127c18c
clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&) + 1036
16 clang           0x00000000012aa234
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 1280
17 clang           0x00000000012a9ce6
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 996
18 clang           0x00000000012a986b
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 175
19 clang           0x0000000001281e8f
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 185
20 clang           0x000000000127b318
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1200
21 clang           0x000000000127add8
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 210
22 clang           0x00000000012638b0 clang::ParseAST(clang::Sema&, bool) + 328
23 clang           0x0000000000fc1945 clang::ASTFrontendAction::ExecuteAction()
+ 263
24 clang           0x000000000110d025 clang::CodeGenAction::ExecuteAction() +
951
25 clang           0x0000000000fc1596 clang::FrontendAction::Execute() + 320
26 clang           0x0000000000fa85bf
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
27 clang           0x0000000000f544bd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 858
28 clang           0x0000000000f46349 cc1_main(char const**, char const**, char
const*, void*) + 1032
29 clang           0x0000000000f4fa24 main + 499
30 libc.so.6       0x00007f23b003ac4d __libc_start_main + 253
31 clang           0x0000000000f459b9
Stack dump:
0.      Program arguments: /llvmdebug/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
t.cc -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.20.1 -momit-leaf-frame-pointer -resource-dir /llvmdebug/bin/../lib/clang/2.9
-ferror-limit 19 -fmessage-length 173 -fexceptions -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o t.o -x c++ t.cc 
1.      t.cc:3:3: at annotation token 
2.      t.cc:3:1: parsing function body 'nt'
3.      t.cc:3:1: in compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (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