[LLVMbugs] [Bug 20226] New: Assertion `!empty()' failed: function default argument in template at block scope
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Jul 7 06:45:40 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20226
Bug ID: 20226
Summary: Assertion `!empty()' failed: function default argument
in template at block scope
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: hstong at ca.ibm.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
clang -cc1 aborts with an assertion on the following small source file.
### SOURCE:
> cat blockScopeDefaultArgInInstantiation.cc
template <class T> void foo() {
void bar(int, int = 0);
bar(0);
}
template void foo<int>();
Return: 0x00:0
### COMPILER INVOCATION:
> clang -cc1 -x c++ blockScopeDefaultArgInInstantiation.cc
clang: /build/llvm-dev.src/include/llvm/ADT/SmallVector.h:154: const T&
llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::front() const
[with T = llvm::ArrayRef<clang::TemplateArgument>; <template-parameter-1-2> =
void; llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2>
>::const_reference = const llvm::ArrayRef<clang::TemplateArgument>&]: Assertion
`!empty()' failed.
0 clang 0x0000000011ff51e4 llvm::sys::PrintStackTrace(_IO_FILE*) +
4279327012
1 clang 0x0000000011ff5450
2 clang 0x0000000011ff4c50
3 linux-vdso64.so.1 0x00000fffa42b0418 __kernel_sigtramp_rt64 + 0
4 libc.so.6 0x00000fffa3dcf7d0 gsignal + 4293466120
5 libc.so.6 0x00000fffa3dd18a4 abort + 4293473372
6 libc.so.6 0x00000fffa3dc63bc
7 libc.so.6 0x00000fffa3dc64ac __assert_fail + 4293432916
8 clang 0x00000000108f0ac0
clang::Sema::BuildCXXDefaultArgExpr(clang::SourceLocation,
clang::FunctionDecl*, clang::ParmVarDecl*) + 4256393448
9 clang 0x00000000108f0ed0
clang::Sema::GatherArgumentsForCall(clang::SourceLocation,
clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int,
llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&,
clang::Sema::VariadicCallType, bool, bool) + 4256394464
10 clang 0x00000000108f1ac4
clang::Sema::ConvertArgumentsForCall(clang::CallExpr*, clang::Expr*,
clang::FunctionDecl*, clang::FunctionProtoType const*,
llvm::ArrayRef<clang::Expr*>, clang::SourceLocation, bool) + 4256397500
11 clang 0x00000000108f2954
clang::Sema::BuildResolvedCallExpr(clang::Expr*, clang::NamedDecl*,
clang::SourceLocation, llvm::ArrayRef<clang::Expr*>, clang::SourceLocation,
clang::Expr*, bool) + 4256401204
12 clang 0x00000000108f3054
clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation,
llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool)
+ 4256402972
13 clang 0x0000000010a91b1c
14 clang 0x0000000010a8bea4
15 clang 0x0000000010a8a3d4
16 clang 0x0000000010a8a744
17 clang 0x0000000010a8a8cc
18 clang 0x0000000010a8a464
19 clang 0x0000000010aae8c0 clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 4258134576
20 clang 0x0000000010ac2c2c
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 4258212860
21 clang 0x0000000010a491f8
clang::Sema::ActOnExplicitInstantiation(clang::Scope*, clang::SourceLocation,
clang::SourceLocation, clang::Declarator&) + 4257742064
22 clang 0x00000000106ab000
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) +
4254119664
23 clang 0x00000000106b0c18
clang::Parser::ParseDeclarationAfterDeclarator(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&) + 4254142784
24 clang 0x0000000010706b50
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) +
4254483200
25 clang 0x000000001070773c
clang::Parser::ParseExplicitInstantiation(unsigned int, clang::SourceLocation,
clang::SourceLocation, clang::SourceLocation&, clang::AccessSpecifier) +
4254486204
26 clang 0x00000000107079f0
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) +
4254486872
27 clang 0x00000000106b8e24
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) +
4254175644
28 clang 0x00000000106a1570
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 4254082472
29 clang 0x00000000106a1d0c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) +
4254084396
30 clang 0x000000001069927c clang::ParseAST(clang::Sema&, bool,
bool) + 4254051060
31 clang 0x00000000102cde5c
clang::ASTFrontendAction::ExecuteAction() + 4250281660
32 clang 0x00000000102cf1b0 clang::FrontendAction::Execute() +
4250285960
33 clang 0x00000000102a9f60
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 4250138448
34 clang 0x000000001028cd68
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4250028376
35 clang 0x0000000010286288 cc1_main(char const**, char const**,
char const*, void*) + 4250001784
36 clang 0x0000000010272028 main + 4249918536
37 libc.so.6 0x00000fffa3db49ec
38 libc.so.6 0x00000fffa3db4bf4 __libc_start_main + 4293363212
Stack dump:
0. Program arguments: clang -cc1 -x c++
blockScopeDefaultArgInInstantiation.cc
1. blockScopeDefaultArgInInstantiation.cc:6:25: current parser token ';'
Aborted (core dumped)
Return: 0x86:134
### COMPILER VERSION INFO:> clang -v
clang version 3.5.0
Target: powerpc64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Selected GCC installation: /usr/lib/gcc/ppc64-redhat-linux/4.4.6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
Return: 0x00:0
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140707/a131e990/attachment.html>
More information about the llvm-bugs
mailing list