LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 8234 - Assertion when instantiating template
Summary: Assertion when instantiating template
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-26 08:22 PDT by Stephen Englsh
Modified: 2010-11-05 18:25 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Code snippet that asserts clang (669 bytes, text/x-c++src)
2010-09-26 08:22 PDT, Stephen Englsh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Englsh 2010-09-26 08:22:18 PDT
Created attachment 5529 [details]
Code snippet that asserts clang

Code & Output cached in http://gist.github.com/597890. With r114794 the attached file causes:
stephen@hanuman:~/ise/production$ ~/dev/bin/clang test.cpp 
clang: SemaTemplateInstantiate.cpp:962: clang::TypeSourceInfo* clang::Sema::SubstType(clang::TypeSourceInfo*, const clang::MultiLevelTemplateArgumentList&, clang::SourceLocation, clang::DeclarationName): Assertion `!ActiveTemplateInstantiations.empty() && "Cannot perform an instantiation without some context on the " "instantiation stack"' failed.
0  clang           0x000000000214fe41
1  clang           0x000000000214fc34
2  libpthread.so.0 0x00007f341098d8f0
3  libc.so.6       0x00007f340fc7ca75 gsignal + 53
4  libc.so.6       0x00007f340fc805c0 abort + 384
5  libc.so.6       0x00007f340fc75941 __assert_fail + 241
6  clang           0x000000000138b086 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) + 132
7  clang           0x000000000138b587 clang::Sema::SubstParmVarDecl(clang::ParmVarDecl*, clang::MultiLevelTemplateArgumentList const&) + 127
8  clang           0x000000000138aca4
9  clang           0x000000000139160d
10 clang           0x000000000138de9a
11 clang           0x000000000138ac5d
12 clang           0x000000000138e7fa
13 clang           0x000000000138e268
14 clang           0x0000000001390c35
15 clang           0x000000000138d2e7 clang::Sema::Subst(clang::TemplateArgumentLoc const&, clang::TemplateArgumentLoc&, clang::MultiLevelTemplateArgumentList const&) + 105
16 clang           0x0000000001380e50
17 clang           0x0000000001384d4e clang::Sema::getMoreSpecializedPartialSpecialization(clang::ClassTemplatePartialSpecializationDecl*, clang::ClassTemplatePartialSpecializationDecl*, clang::SourceLocation) + 348
18 clang           0x000000000138c4dd clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) + 889
19 clang           0x00000000013bb1a5 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::PartialDiagnostic const&, std::pair<clang::SourceLocation, clang::PartialDiagnostic>) + 317
20 clang           0x00000000013bb623 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, unsigned int) + 167
21 clang           0x0000000001243bb6 clang::Sema::ActOnUninitializedDecl(clang::Decl*, bool) + 1344
22 clang           0x00000000011aaec5 clang::Parser::ParseDeclarationAfterDeclarator(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&) + 2363
23 clang           0x00000000011aa2bd clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*) + 741
24 clang           0x00000000011a9fb7 clang::Parser::ParseSimpleDeclaration(unsigned int, clang::SourceLocation&, clang::AttributeList*, bool) + 399
25 clang           0x00000000011a9dec clang::Parser::ParseDeclaration(unsigned int, clang::SourceLocation&, clang::CXX0XAttributeList) + 896
26 clang           0x0000000001199419 clang::Parser::ParseStatementOrDeclaration(bool) + 737
27 clang           0x000000000119a4d6 clang::Parser::ParseCompoundStatementBody(bool) + 248
28 clang           0x000000000119de0d clang::Parser::ParseFunctionStatementBody(clang::Decl*) + 115
29 clang           0x00000000011a40ab clang::Parser::ParseFunctionDefinition(clang::Parser::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&) + 1069
30 clang           0x00000000011aa1d6 clang::Parser::ParseDeclGroup(clang::Parser::ParsingDeclSpec&, unsigned int, bool, clang::SourceLocation*) + 510
31 clang           0x00000000011a3bf4 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&, clang::AttributeList*, clang::AccessSpecifier) + 1058
32 clang           0x00000000011a3c5f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::AttributeList*, clang::AccessSpecifier) + 95
33 clang           0x00000000011a35bf clang::Parser::ParseExternalDeclaration(clang::CXX0XAttributeList, clang::Parser::ParsingDeclSpec*) + 1681
34 clang           0x00000000011a2e9f clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 267
35 clang           0x000000000118cc88 clang::ParseAST(clang::Sema&, bool) + 328
36 clang           0x0000000000f0b020 clang::ASTFrontendAction::ExecuteAction() + 264
37 clang           0x000000000102b114 clang::CodeGenAction::ExecuteAction() + 988
38 clang           0x0000000000f0ac6a clang::FrontendAction::Execute() + 320
39 clang           0x0000000000ef4e68 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 752
40 clang           0x0000000000ea8aec clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 856
41 clang           0x0000000000e9bf5f cc1_main(char const**, char const**, char const*, void*) + 958
42 clang           0x0000000000ea48fa main + 499
43 libc.so.6       0x00007f340fc67c4d __libc_start_main + 253
44 clang           0x0000000000e9b619
Stack dump:
0.	Program arguments: /home/stephen/dev/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name test.cpp -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1 -resource-dir /home/stephen/dev/lib/clang/2.9 -ferror-limit 19 -fmessage-length 179 -fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-tl45qE.s -x c++ test.cpp 
1.	test.cpp:22:34: current parser token ';'
2.	test.cpp:21:1: parsing function body 'main'
3.	test.cpp:21:1: in compound statement ('{}')
clang: error: clang frontend command failed due to signal 6 (use -v to see invocation)
Comment 1 Argyrios Kyrtzidis 2010-11-05 18:25:57 PDT
Fixed at r118314.