<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Crash on invalid during template function instantiation"
href="http://llvm.org/bugs/show_bug.cgi?id=18246">18246</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash on invalid during template function instantiation
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rtrieu@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>test.cc:
template <typename T>
class Baz {
public:
template <unsigned N>
void bar();
};
template <typename T>
template <unsigned N>
void Baz<T>::bar() {
}
template <typename T>
void Baz<T>::bar<0>() {
}
Affects:
3.1, 3.2, 3.3, 3.4 candidate, ToT
Commandline:
clang -cc1 test.cc
Output:
test.cc:14:14: error: template specialization requires 'template<>'
void Baz<T>::bar<0>() {
^ ~~~
template<>
clang: llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:1473:
clang::QualType
{anonymous}::TemplateInstantiator::TransformTemplateTypeParmType(clang::TypeLocBuilder&,
clang::TemplateTypeParmTypeLoc): Assertion `Arg.getKind() ==
TemplateArgument::Type && "Template argument kind mismatch"' failed.
0 clang 0x0000000001e8c55f llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1 clang 0x0000000001e8c7e6
2 clang 0x0000000001e8c22a
3 libpthread.so.0 0x00007f6f39c5ecb0
4 libc.so.6 0x00007f6f390b3425 gsignal + 53
5 libc.so.6 0x00007f6f390b6b8b abort + 379
6 libc.so.6 0x00007f6f390ac0ee
7 libc.so.6 0x00007f6f390ac192
8 clang 0x0000000002f317d9
9 clang 0x0000000002f39ba8
10 clang 0x0000000002f38d3d
11 clang 0x0000000002f5b6a2
12 clang 0x0000000002f5c9c3
13 clang 0x0000000002f54f26
14 clang 0x0000000002f5a9d8
15 clang 0x0000000002f539a2
16 clang 0x0000000002f3d8d9
17 clang 0x0000000002f35cf3
clang::Sema::SubstNestedNameSpecifierLoc(clang::NestedNameSpecifierLoc,
clang::MultiLevelTemplateArgumentList const&) + 207
18 clang 0x0000000002f6e220
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*,
clang::TemplateParameterList*, bool) + 944
19 clang 0x0000000002f71a18
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*) + 42
20 clang 0x0000000002f60955
21 clang 0x0000000002f721ee clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&) + 142
22 clang 0x0000000002ef888b
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*) + 2395
23 clang 0x0000000002efae9a
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&,
clang::sema::TemplateDeductionInfo&, bool) + 902
24 clang 0x0000000002e95368
clang::Sema::CheckFunctionTemplateSpecialization(clang::FunctionDecl*,
clang::TemplateArgumentListInfo*, clang::LookupResult&) + 744
25 clang 0x0000000002c0efe5
clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&,
clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&,
llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) + 10241
26 clang 0x0000000002c0438e
clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&,
llvm::MutableArrayRef<clang::TemplateParameterList*>) + 2868
27 clang 0x0000000002e94905
clang::Sema::ActOnStartOfFunctionTemplateDef(clang::Scope*,
llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Declarator&) + 159
28 clang 0x00000000029b06fd
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) +
2271
29 clang 0x0000000002a2036e
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1990
30 clang 0x0000000002a1fb44
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 1084
31 clang 0x0000000002a1f6ee
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 214
32 clang 0x00000000029c0bbf
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 239
33 clang 0x00000000029aefac
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1680
34 clang 0x00000000029ae8ec
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 550
35 clang 0x00000000029ab01d clang::ParseAST(clang::Sema&, bool, bool)
+ 597
36 clang 0x0000000001f58bd3 clang::ASTFrontendAction::ExecuteAction()
+ 321
37 clang 0x0000000001f58712 clang::FrontendAction::Execute() + 200
38 clang 0x0000000001f2b27c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 720
39 clang 0x000000000202d076
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1018
40 clang 0x0000000000d11db3 cc1_main(char const**, char const**, char
const*, void*) + 717
41 clang 0x0000000000d0c2de main + 786
42 libc.so.6 0x00007f6f3909e76d __libc_start_main + 237
43 clang 0x0000000000d0abd9
Stack dump:
0. Program arguments: clang -cc1 test.cc
1. test.cc:14:23: current parser token '{'
Aborted (core dumped)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>