[LLVMbugs] [Bug 9789] New: crash after error in non-type variadic template parameters

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Apr 24 10:33:54 PDT 2011


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

           Summary: crash after error in non-type variadic template
                    parameters
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


This input:

template<int ...Values, int After> struct X0nt;
X0nt<42> f();

Causes clang to crash:


tmp.cpp:1:17: error: template parameter pack must be the last template
parameter
template<int ...Values, int After> struct X0nt;
                ^
clang++: src/tools/clang/lib/Sema/SemaTemplate.cpp:1705: clang::QualType
clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation,
clang::TemplateArgumentListInfo&): Assertion `(Converted.size() ==
Template->getTemplateParameters()->size()) && "Converted template argument list
is too short!"' failed.
0  libLLVM-3.0svn.so 0x00007f4c3386eb55
1  libLLVM-3.0svn.so 0x00007f4c3386e948
2  libpthread.so.0   0x00007f4c31e088f0
3  libc.so.6         0x00007f4c310f7a75 gsignal + 53
4  libc.so.6         0x00007f4c310fb5c0 abort + 384
5  libc.so.6         0x00007f4c310f0941 __assert_fail + 241
6  clang++           0x0000000000f086b7
clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation,
clang::TemplateArgumentListInfo&) + 661
7  clang++           0x0000000000f090de
clang::Sema::ActOnTemplateIdType(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation,
clang::SourceLocation, clang::ASTTemplateArgsPtr, clang::SourceLocation) + 964
8  clang++           0x0000000000d4aeb0
clang::Parser::AnnotateTemplateIdTokenAsType() + 284
9  clang++           0x0000000000d2087a
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 3722
10 clang++           0x0000000000d16161
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 93
11 clang++           0x0000000000d16585
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 113
12 clang++           0x0000000000d15f00
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2192
13 clang++           0x0000000000d155cd
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 225
14 clang++           0x0000000000cfc9ec clang::ParseAST(clang::Sema&, bool) +
413
15 clang++           0x0000000000a586b3
clang::ASTFrontendAction::ExecuteAction() + 263
16 clang++           0x0000000000a58304 clang::FrontendAction::Execute() + 326
17 clang++           0x0000000000a3f4c1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 751
18 clang++           0x00000000009e67d7
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 908
19 clang++           0x00000000009d8457 cc1_main(char const**, char const**,
char const*, void*) + 982
20 clang++           0x00000000009e1f25 main + 499
21 libc.so.6         0x00007f4c310e2c4d __libc_start_main + 253
22 clang++           0x00000000009d7af9
Stack dump:
0.      Program arguments: clang++ -cc1 -std=c++0x -fsyntax-only tmp.cpp 
1.      tmp.cpp:2:1: at annotation token 
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