[LLVMbugs] [Bug 9902] New: ICE with alias templates
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed May 11 13:23:08 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=9902
Summary: ICE with alias templates
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: hhinnant at apple.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Apple clang version 3.0 (trunk 131179) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.7.0
Thread model: posix
template <class _Tp, class _Up, bool = false>
struct __allocator_traits_rebind
{
};
template <template <class, class...> class _Alloc, class _Tp, class ..._Args,
class _Up>
struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>
{
typedef _Alloc<_Up, _Args...> type;
};
template <class Alloc>
struct allocator_traits
{
template <class T> using rebind_alloc = typename
__allocator_traits_rebind<Alloc, T>::type;
template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
};
template <class T>
struct allocator {};
int main()
{
allocator_traits<allocator<char>>::rebind_alloc<int> a;
}
0 clang 0x0000000100cad682 PrintStackTrace(void*) + 34
1 clang 0x0000000100cadb39 SignalHandler(int) + 601
2 libSystem.B.dylib 0x00007fff81e0e66a _sigtramp + 26
3 libSystem.B.dylib 000000000000000000 _sigtramp + 2115967408
4 clang 0x00000001003c6c97
clang::TemplateDeclInstantiator::VisitTemplateTypeParmDecl(clang::TemplateTypeParmDecl*)
+ 215
5 clang 0x00000001003c9dc3
clang::DeclVisitor<clang::TemplateDeclInstantiator,
clang::Decl*>::Visit(clang::Decl*) + 339
6 clang 0x00000001003c0d54
clang::Sema::FindInstantiatedDecl(clang::SourceLocation, clang::NamedDecl*,
clang::MultiLevelTemplateArgumentList const&) + 372
7 clang 0x00000001003bbf07 (anonymous
namespace)::TemplateInstantiator::TransformDecl(clang::SourceLocation,
clang::Decl*) + 375
8 clang 0x00000001003abe9f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) + 5871
9 clang 0x00000001003aa4b9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) + 233
10 clang 0x00000001003bafab clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateArgument(clang::TemplateArgumentLoc
const&, clang::TemplateArgumentLoc&) + 155
11 clang 0x00000001003bcf91 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformTemplateSpecializationType(clang::TypeLocBuilder&,
clang::TemplateSpecializationTypeLoc, clang::TemplateName) + 2769
12 clang 0x00000001003b89f5 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformNestedNameSpecifierLoc(clang::NestedNameSpecifierLoc,
clang::QualType, clang::NamedDecl*) + 645
13 clang 0x00000001003ac1ba clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) + 6666
14 clang 0x00000001003aa4b9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) + 233
15 clang 0x00000001003acb2f clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::QualType) + 79
16 clang 0x00000001003acad6 clang::Sema::SubstType(clang::QualType,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName) + 54
17 clang 0x00000001003640bd
clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation,
clang::TemplateArgumentListInfo&) + 557
18 clang 0x0000000100365569
clang::Sema::ActOnTemplateIdType(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation,
clang::SourceLocation, clang::ASTTemplateArgsPtr, clang::SourceLocation) + 729
19 clang 0x00000001001f9df1
clang::Parser::AnnotateTemplateIdTokenAsType() + 65
20 clang 0x000000010020101d
clang::Parser::TryAnnotateTypeOrScopeToken(bool) + 1677
21 clang 0x00000001001fa98b
clang::Parser::isCXXDeclarationSpecifier() + 91
22 clang 0x00000001001fb726
clang::Parser::isCXXTypeId(clang::Parser::TentativeCXXTypeIdContext, bool&) +
38
23 clang 0x00000001001f9e88 clang::Parser::ParseTemplateArgument()
+ 40
24 clang 0x00000001001f990c
clang::Parser::ParseTemplateArgumentList(llvm::SmallVector<clang::ParsedTemplateArgument,
16u>&) + 204
25 clang 0x00000001001f9536
clang::Parser::ParseTemplateIdAfterTemplateName(clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::CXXScopeSpec const&, bool,
clang::SourceLocation&, llvm::SmallVector<clang::ParsedTemplateArgument, 16u>&,
clang::SourceLocation&) + 134
26 clang 0x00000001001f9a75
clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr<clang::TemplateName>,
clang::TemplateNameKind, clang::CXXScopeSpec&, clang::UnqualifiedId&,
clang::SourceLocation, bool) + 133
27 clang 0x00000001001e1644
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool) + 3236
28 clang 0x0000000100201167
clang::Parser::TryAnnotateCXXScopeToken(bool) + 71
29 clang 0x00000001001caf8a
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 4890
30 clang 0x00000001001c6ee6
clang::Parser::ParseSpecifierQualifierList(clang::DeclSpec&) + 70
31 clang 0x00000001001c6bec
clang::Parser::ParseTypeName(clang::SourceRange*,
clang::Declarator::TheContext) + 236
32 clang 0x00000001001d4b2f
clang::Parser::ParseUsingDeclaration(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::SourceLocation,
clang::SourceLocation&, clang::AccessSpecifier) + 1343
33 clang 0x00000001001d8474
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 1636
34 clang 0x00000001001f77f2
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 66
35 clang 0x00000001001f7610
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 720
36 clang 0x00000001001f72ab
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 299
37 clang 0x00000001001d8343
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 1331
38 clang 0x00000001001d72c3
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 1475
39 clang 0x00000001001d6925
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 4501
40 clang 0x00000001001ca524
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 2228
41 clang 0x00000001001f7a0c
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 604
42 clang 0x00000001001f7610
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 720
43 clang 0x00000001001f72ab
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 299
44 clang 0x00000001001c9706
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 390
45 clang 0x00000001001fec42
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1394
46 clang 0x00000001001fe6a5
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 229
47 clang 0x00000001001c523d clang::ParseAST(clang::Sema&, bool) +
301
48 clang 0x00000001001a918f clang::CodeGenAction::ExecuteAction() +
671
49 clang 0x00000001000294db
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
50 clang 0x0000000100009838
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2536
51 clang 0x00000001000027a5 cc1_main(char const**, char const**,
char const*, void*) + 5221
52 clang 0x00000001000060bb main + 667
53 clang 0x0000000100001334 start + 52
Stack dump:
0. Program arguments:
/Users/hhinnant/Downloads/current-clang/Developer/usr/bin/clang -cc1 -triple
x86_64-apple-macosx10.6.7 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.cpp -pic-level 1 -mdisable-fp-elim
-relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 123.2 -resource-dir
/Users/hhinnant/Downloads/current-clang/Developer/usr/bin/../lib/clang/3.0
-nostdinc++ -cxx-isystem /usr/include/c++/v1 -std=c++0x -fdeprecated-macro
-ferror-limit 19 -fmessage-length 138 -stack-protector 1 -fblocks
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/var/folders/9S/9SAm-D9iHUW4BIKyeX7pTE+++TI/-Tmp-/cc-msStZM.o -x c++ test.cpp
1. test.cpp:16:63: at annotation token
2. test.cpp:13:1: parsing struct/union/class body 'allocator_traits'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)
--
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