[LLVMbugs] [Bug 8018] New: clang c++ crash on invalid with templates taking enum arguments
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Aug 29 12:05:19 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=8018
Summary: clang c++ crash on invalid with templates taking enum
arguments
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: sharparrow1 at yahoo.com
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
Testcase:
enum X { L };
template<X x> struct Sa { enum E {}; };
template<X x> struct Sb {
template< typename Sa< x >::E e > class C;
C<1> y;
};
Sb<L> t;
Backtrace:
#0 0x0000000000f492fe in clang::BuiltinType::getKind (this=0x0)
at
/home/eli/llvm/tools/clang/lib/Frontend/../../include/clang/AST/Type.h:1120
#1 0x00000000015abb59 in VisitIntegerLiteral (this=0x7fffffff6750,
Node=0x30a6808) at /home/eli/llvm/tools/clang/lib/AST/StmtPrinter.cpp:599
#2 0x00000000015afe8b in Visit (this=0x7fffffff6750, S=0x30a6808)
at
/home/eli/llvmbin/tools/clang/lib/AST/../../include/clang/AST/StmtNodes.inc:373
#3 0x00000000015a9adc in Visit (this=0x7fffffff6750, S=0x30a6808)
at /home/eli/llvm/tools/clang/lib/AST/StmtPrinter.cpp:83
#4 0x00000000015af219 in clang::Stmt::printPretty (this=0x30a6808, OS=...,
Context=..., Helper=0x0, Policy=..., Indentation=0)
at /home/eli/llvm/tools/clang/lib/AST/StmtPrinter.cpp:1344
#5 0x00000000013f86ff in clang::Stmt::printPretty (this=0x30a6808, OS=...,
Helper=0x0, Policy=..., Indentation=0)
at
/home/eli/llvm/tools/clang/lib/Checker/../../include/clang/AST/Stmt.h:218
#6 0x00000000015cabf0 in PrintTemplateArgument (Buffer=..., Arg=...,
Policy=...)
at /home/eli/llvm/tools/clang/lib/AST/TypePrinter.cpp:715
#7 0x00000000015cad11 in
clang::TemplateSpecializationType::PrintTemplateArgumentList (Args=0x30a69a0,
NumArgs=1, Policy=...)
at /home/eli/llvm/tools/clang/lib/AST/TypePrinter.cpp:746
#8 0x0000000001595a0e in clang::NestedNameSpecifier::print (this=0x30a69f4,
OS=..., Policy=...)
---Type <return> to continue, or q <return> to quit---
at /home/eli/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp:166
#9 0x00000000015c9f3e in PrintElaborated (this=0x7fffffff6c70, T=0x30a6c00,
S=...) at /home/eli/llvm/tools/clang/lib/AST/TypePrinter.cpp:557
#10 0x00000000015c75b0 in Print (this=0x7fffffff6c70, T=..., S=...)
at
/home/eli/llvm/tools/clang/lib/AST/../../include/clang/AST/TypeNodes.def:89
#11 0x00000000015cb2e0 in clang::QualType::getAsStringInternal (
this=0x7fffffff6cf0, S=..., Policy=...)
at /home/eli/llvm/tools/clang/lib/AST/TypePrinter.cpp:856
#12 0x00000000011c8233 in clang::QualType::getAsString (this=0x7fffffff6cf0,
Policy=...)
at /home/eli/llvm/tools/clang/lib/Sema/../../include/clang/AST/Type.h:666
#13 0x0000000001518c3c in ConvertTypeToDiagnosticString (Context=..., Ty=...,
PrevArgs=0x7fffffff6f78, NumPrevArgs=1)
at /home/eli/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp:131
#14 0x0000000001518f18 in clang::FormatASTNodeDiagnosticArgument (
Kind=clang::Diagnostic::ak_qualtype, Val=51014656, Modifier=0x0, ModLen=0,
Argument=0x0, ArgLen=0, PrevArgs=0x7fffffff6f78, NumPrevArgs=1, Output=...,
Cookie=0x306f8f0) at
/home/eli/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp:187
#15 0x0000000001650d1c in clang::Diagnostic::ConvertArgToString
(this=0x3065800,
Kind=clang::Diagnostic::ak_qualtype, Val=51014656, Modifier=0x0, ModLen=0,
Argument=0x0, ArgLen=0, PrevArgs=0x7fffffff6f78, NumPrevArgs=1, Output=...)
at
/home/eli/llvm/tools/clang/lib/Basic/../../include/clang/Basic/Diagnostic.h---Type
<return> to continue, or q <return> to quit---
:424
#16 0x000000000164ef0f in clang::DiagnosticInfo::FormatDiagnostic (
this=0x7fffffff74f0, DiagStr=0x23ea8e7 "", DiagEnd=0x23ea8e7 "",
OutStr=...)
at /home/eli/llvm/tools/clang/lib/Basic/Diagnostic.cpp:1028
#17 0x000000000164e6e4 in clang::DiagnosticInfo::FormatDiagnostic (
this=0x7fffffff74f0, OutStr=...)
at /home/eli/llvm/tools/clang/lib/Basic/Diagnostic.cpp:888
#18 0x0000000000ee48d4 in clang::TextDiagnosticPrinter::HandleDiagnostic (
this=0x3065fa0, Level=clang::Diagnostic::Error, Info=...)
at /home/eli/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp:830
#19 0x000000000164dd72 in clang::Diagnostic::ProcessDiag (this=0x3065800)
at /home/eli/llvm/tools/clang/lib/Basic/Diagnostic.cpp:617
#20 0x000000000164de33 in clang::DiagnosticBuilder::Emit (this=0x7fffffff7780)
at /home/eli/llvm/tools/clang/lib/Basic/Diagnostic.cpp:641
#21 0x0000000001187385 in ~SemaDiagnosticBuilder (this=0x7fffffff7780,
__in_chrg=<value optimized out>)
at /home/eli/llvm/tools/clang/lib/Sema/Sema.cpp:430
#22 0x00000000012f1600 in clang::Sema::CheckTemplateArgument (this=0x308a410,
Param=0x30a6c50, InstantiatedParamType=..., Arg=@0x7fffffff7f08,
Converted=..., CTAK=clang::Sema::CTAK_Specified)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplate.cpp:2804
#23 0x00000000012eda9f in clang::Sema::CheckTemplateArgument (this=0x308a410,
Param=0x30a6c50, Arg=..., Template=0x30a6d60, TemplateLoc=...,
---Type <return> to continue, or q <return> to quit---
RAngleLoc=..., Converted=..., CTAK=clang::Sema::CTAK_Specified)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplate.cpp:2038
#24 0x00000000012ee634 in clang::Sema::CheckTemplateArgumentList (
this=0x308a410, Template=0x30a6d60, TemplateLoc=..., TemplateArgs=...,
PartialTemplateArgs=false, Converted=...)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplate.cpp:2244
#25 0x00000000012eb81c in clang::Sema::CheckTemplateIdType (this=0x308a410,
Name=..., TemplateLoc=..., TemplateArgs=...)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplate.cpp:1417
#26 0x00000000013453df in RebuildTemplateSpecializationType (
this=0x7fffffff8a40, Template=..., TemplateNameLoc=..., TemplateArgs=...)
at /home/eli/llvm/tools/clang/lib/Sema/TreeTransform.h:6514
#27 0x00000000013367a1 in TransformTemplateSpecializationType (
this=0x7fffffff8a40, TLB=..., TL=..., ObjectType=...)
at /home/eli/llvm/tools/clang/lib/Sema/TreeTransform.h:3260
#28 0x00000000013305e6 in TransformType (this=0x7fffffff8a40, TLB=..., T=...,
ObjectType=...)
at
/home/eli/llvm/tools/clang/lib/Sema/../../include/clang/AST/TypeNodes.def:92
#29 0x000000000132fd78 in TransformType (this=0x7fffffff8a40, DI=0x30a4740,
ObjectType=...) at /home/eli/llvm/tools/clang/lib/Sema/TreeTransform.h:2401
#30 0x000000000132cae8 in clang::Sema::SubstType (this=0x308a410, T=0x30a4740,
Args=..., Loc=..., Entity=...)
---Type <return> to continue, or q <return> to quit---
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:968
#31 0x000000000134d25d in VisitFieldDecl (this=0x7fffffff8c30, D=0x30a4770)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:475
#32 0x0000000001355265 in Visit (this=0x7fffffff8c30, D=0x30a4770)
at
/home/eli/llvmbin/tools/clang/lib/Sema/../../include/clang/AST/DeclNodes.inc:261
#33 0x0000000001351aa0 in clang::Sema::SubstDecl (this=0x308a410, D=0x30a4770,
Owner=0x30a4820, TemplateArgs=...)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp:1690
#34 0x000000000132d914 in clang::Sema::InstantiateClass (this=0x308a410,
PointOfInstantiation=..., Instantiation=0x30a47f0, Pattern=0x30a3c60,
TemplateArgs=..., TSK=clang::TSK_ImplicitInstantiation, Complain=true)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:1225
#35 0x000000000132e2ce in clang::Sema::InstantiateClassTemplateSpecialization (
this=0x308a410, PointOfInstantiation=..., ClassTemplateSpec=0x30a47f0,
TSK=clang::TSK_ImplicitInstantiation, Complain=true)
at /home/eli/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp:1419
#36 0x000000000135ec2b in clang::Sema::RequireCompleteType (this=0x308a410,
Loc=..., T=..., PD=..., Note=...)
at /home/eli/llvm/tools/clang/lib/Sema/SemaType.cpp:2092
#37 0x000000000135f0a9 in clang::Sema::RequireCompleteType (this=0x308a410,
Loc=..., T=..., DiagID=1937)
at /home/eli/llvm/tools/clang/lib/Sema/SemaType.cpp:2149
---Type <return> to continue, or q <return> to quit---
#38 0x00000000011e2b7f in clang::Sema::ActOnUninitializedDecl (this=0x308a410,
dcl=..., TypeContainsUndeducedAuto=false)
at /home/eli/llvm/tools/clang/lib/Sema/SemaDecl.cpp:4410
#39 0x00000000015ed36d in clang::Parser::ParseDeclarationAfterDeclarator (
this=0x7fffffffca20, D=..., TemplateInfo=...)
at /home/eli/llvm/tools/clang/lib/Parse/ParseDecl.cpp:635
#40 0x00000000015ec5fe in clang::Parser::ParseDeclGroup (this=0x7fffffffca20,
DS=..., Context=0, AllowFunctionDefinitions=true, DeclEnd=0x0)
at /home/eli/llvm/tools/clang/lib/Parse/ParseDecl.cpp:433
#41 0x00000000015e6a72 in clang::Parser::ParseDeclarationOrFunctionDefinition (
this=0x7fffffffca20, DS=..., Attr=0x0, AS=clang::AS_none)
at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:606
#42 0x00000000015e6adf in clang::Parser::ParseDeclarationOrFunctionDefinition (
this=0x7fffffffca20, Attr=0x0, AS=clang::AS_none)
at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:613
#43 0x00000000015e63d1 in clang::Parser::ParseExternalDeclaration (
this=0x7fffffffca20, Attr=...)
at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:497
#44 0x00000000015e5d11 in clang::Parser::ParseTopLevelDecl
(this=0x7fffffffca20,
Result=...) at /home/eli/llvm/tools/clang/lib/Parse/Parser.cpp:367
#45 0x0000000001184183 in clang::ParseAST (S=..., PrintStats=false)
at /home/eli/llvm/tools/clang/lib/Sema/ParseAST.cpp:82
#46 0x0000000000ed53a8 in clang::ASTFrontendAction::ExecuteAction (
---Type <return> to continue, or q <return> to quit---
this=0x305fab0)
at /home/eli/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:264
#47 0x0000000000ed4ff2 in clang::FrontendAction::Execute (this=0x305fab0)
at /home/eli/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:184
#48 0x0000000000ebbd2e in clang::CompilerInstance::ExecuteAction (
this=0x305f700, Act=...)
at /home/eli/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:526
#49 0x0000000000ed3cf4 in clang::ExecuteCompilerInvocation (Clang=0x305f700)
at
/home/eli/llvm/tools/clang/lib/Frontend/ExecuteCompilerInvocation.cpp:148
#50 0x0000000000eadc5f in cc1_main (ArgBegin=0x7fffffffd3a8,
ArgEnd=0x7fffffffd3b8,
Argv0=0x305f548 "/home/eli/llvmbin/Debug+Asserts/bin/clang",
MainAddr=0xeb52b0)
at /home/eli/llvm/tools/clang/tools/driver/cc1_main.cpp:160
#51 0x0000000000eb658e in main (argc_=4, argv_=0x7fffffffe2b8)
at /home/eli/llvm/tools/clang/tools/driver/driver.cpp:268
--
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