[LLVMbugs] [Bug 13272] New: assertion and crash on variadic template code
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jul 4 11:40:05 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13272
Bug #: 13272
Summary: assertion and crash on variadic template code
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P
Component: C++11
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: devlists at shadowlab.org
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 8830
--> http://llvm.org/bugs/attachment.cgi?id=8830
Test case.
Assertion failed when parsing the attached code.
I don't think this code is valid, anyway clang should report an error, not
crash.
------- crash.cpp
#include <type_traits>
class Exception;
template<class Ex, typename... Args>
void cxx_throw(typename std::enable_if<(sizeof...(Args) > 0), const char
*>::type fmt, Args&&... args) {
return;
}
void test() {
cxx_throw<Exception>("Youpi");
}
-------
$ clang++ -fsyntax-only -std=c++11 -stdlib=libc++ crash.cpp
Assertion failed: (isa<LabelDecl>(D) && "declaration not instantiated in this
scope"), function findInstantiationOf, file
/Users/jddupas/Projects/OpenSource/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp,
line 2562.
[…]
5 clang 0x000000010721daa1 __assert_rtn + 81
6 clang 0x00000001063a71b7
clang::LocalInstantiationScope::findInstantiationOf(clang::Decl const*) + 215
7 clang 0x00000001063afcfa
clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*,
clang::MultiLevelTemplateArgumentList const&) + 218
8 clang 0x00000001063a935e (anonymous
namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation,
clang::Decl*) + 286
9 clang 0x000000010639ee5b clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 12203
10 clang 0x00000001063ab25b clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformBinaryOperator(clang::BinaryOperator*)
+ 43
11 clang 0x000000010639f203 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 13139
12 clang 0x000000010639ea9f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 11247
13 clang 0x00000001063a899c clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&) + 492
…
--
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