[LLVMbugs] [Bug 17191] New: Assertion failed: ((!Canon.isNull() || T.isDependent() || ::anyDependentTemplateArguments(Args, NumArgs, InstantiationDependent)) && "No canonical type for non-dependent class template specialization")

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 11 06:19:38 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17191

            Bug ID: 17191
           Summary: Assertion failed: ((!Canon.isNull() || T.isDependent()
                    || ::anyDependentTemplateArguments(Args, NumArgs,
                    InstantiationDependent)) && "No canonical type for
                    non-dependent class template specialization")
           Product: clang
           Version: trunk
          Hardware: PC
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: glider at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

To reproduce:

$ clang -x objective-c++ -arch i386 -fmessage-length=0 -std=gnu++11 -fobjc-arc 
-fno-rtti  -fstric
t-aliasing  -g -fvisibility=hidden -fno-threadsafe-statics 
-fobjc-abi-version=2   -w   -c MPS.ii -o MPS.o

MPS.ii:1:39: error: expected a qualified name after 'typename'
      template <class _Tp>   typename remove_reference<int>  {
                                      ^
MPS.ii:1:55: error: expected ';' at end of declaration
      template <class _Tp>   typename remove_reference<int>  {
                                                      ^
                                                      ;
MPS.ii:1:56: error: expected identifier
      template <class _Tp>   typename remove_reference<int>  {
                                                       ^
MPS.ii:1:62: error: expected unqualified-id
      template <class _Tp>   typename remove_reference<int>  {
                                                             ^
MPS.ii:4:25: error: use of undeclared identifier '__pointer_type_imp'; did you
mean '__pointer_type'?
       typedef typename __pointer_type_imp::__pointer_type<int, typename
remove_reference<int>::type>::type type;
                        ^~~~~~~~~~~~~~~~~~
                        __pointer_type
MPS.ii:3:37: note: '__pointer_type' declared here
        template <class _Tp> struct __pointer_type {
                                    ^
Assertion failed: ((!Canon.isNull() || T.isDependent() ||
::anyDependentTemplateArguments(Args, NumArgs, InstantiationDependent)) && "No
canonical type for non-dependent class template specialization"), function
TemplateSpecializationType, file
/Users/glider/src/asan-new-removeothers/llvm/tools/clang/lib/AST/Type.cpp, line
1994.
0  clang-3.4         0x00000001087b0188 llvm::sys::PrintStackTrace(__sFILE*) +
40
1  clang-3.4         0x00000001087b06d4 SignalHandler(int) + 644
2  libsystem_c.dylib 0x00007fff8cbe894a _sigtramp + 26
3  libsystem_c.dylib 0x00007fff58283ee0 _sigtramp + 3412702640
4  clang-3.4         0x00000001087b0436 abort + 22
5  clang-3.4         0x00000001087b0411 __assert_rtn + 81
6  clang-3.4         0x00000001089661d5
clang::TemplateSpecializationType::TemplateSpecializationType(clang::TemplateName,
clang::TemplateArgument const*, unsigned int, clang::QualType, clang::QualType)
+ 533
7  clang-3.4         0x00000001087c9dcd
clang::ASTContext::getCanonicalTemplateSpecializationType(clang::TemplateName,
clang::TemplateArgument const*, unsigned int) const + 621
8  clang-3.4         0x00000001087c99cb
clang::ASTContext::getTemplateSpecializationType(clang::TemplateName,
clang::TemplateArgument const*, unsigned int, clang::QualType) const + 251
9  clang-3.4         0x00000001087c9810
clang::ASTContext::getTemplateSpecializationType(clang::TemplateName,
clang::TemplateArgumentListInfo const&, clang::QualType) const + 368
10 clang-3.4         0x0000000108ff9baa
clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation,
clang::TemplateArgumentListInfo&) + 1834
11 clang-3.4         0x0000000108d9b2fc
clang::Sema::ActOnCXXNestedNameSpecifier(clang::Scope*, clang::CXXScopeSpec&,
clang::SourceLocation, clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::SourceLocation,
llvm::MutableArrayRef<clang::ParsedTemplateArgument>, clang::SourceLocation,
clang::SourceLocation, bool) + 1004
12 clang-3.4         0x0000000108d0c5b8
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool, clang::IdentifierInfo**)
+ 5352
13 clang-3.4         0x0000000108d4e5f4
clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 804
14 clang-3.4         0x0000000108d434fc
clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*) + 988
15 clang-3.4         0x0000000108d45308
clang::Parser::isCXXTypeId(clang::Parser::TentativeCXXTypeIdContext, bool&) +
56
16 clang-3.4         0x0000000108d41f67 clang::Parser::ParseTemplateArgument()
+ 55
17 clang-3.4         0x0000000108d415eb
clang::Parser::ParseTemplateArgumentList(llvm::SmallVector<clang::ParsedTemplateArgument,
16u>&) + 91
18 clang-3.4         0x0000000108d4150d
clang::Parser::ParseTemplateIdAfterTemplateName(clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::CXXScopeSpec const&, bool,
clang::SourceLocation&, llvm::SmallVector<clang::ParsedTemplateArgument, 16u>&,
clang::SourceLocation&) + 93
19 clang-3.4         0x0000000108d41866
clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr<clang::TemplateName>,
clang::TemplateNameKind, clang::CXXScopeSpec&, clang::SourceLocation,
clang::UnqualifiedId&, bool) + 198
20 clang-3.4         0x0000000108d0bd66
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool, clang::IdentifierInfo**)
+ 3222
21 clang-3.4         0x0000000108d4e5f4
clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 804
22 clang-3.4         0x0000000108cd8349
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 6505
23 clang-3.4         0x0000000108cf66c1
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 2577
24 clang-3.4         0x0000000108cf3e64
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 2212
25 clang-3.4         0x0000000108cf2c01
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 9393
26 clang-3.4         0x0000000108cd765b
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 3195
27 clang-3.4         0x0000000108d3dc42
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 546
28 clang-3.4         0x0000000108d3d5c6
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 886
29 clang-3.4         0x0000000108d3cfe4
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 292
30 clang-3.4         0x0000000108cd65cf
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) + 895
31 clang-3.4         0x0000000108d4a7bd
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 1837
32 clang-3.4         0x0000000108d4a00e
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 318
33 clang-3.4         0x0000000108cc8b26 clang::ParseAST(clang::Sema&, bool,
bool) + 438
34 clang-3.4         0x0000000108b228d1 clang::CodeGenAction::ExecuteAction() +
545
35 clang-3.4         0x0000000108c36127 clang::FrontendAction::Execute() + 119
36 clang-3.4         0x0000000108c0f22d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973
37 clang-3.4         0x00000001087b3435
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 4005
38 clang-3.4         0x000000010797a8ab cc1_main(char const**, char const**,
char const*, void*) + 811
39 clang-3.4         0x0000000107979323 main + 8419
40 libdyld.dylib     0x00007fff947b87e1 start + 0
41 libdyld.dylib     0x0000000000000038 start + 1803843671
Stack dump:
0.      Program arguments:
/Users/glider/src/asan-new-removeothers/llvm/llvm_cmake_build/bin/clang-3.4
-cc1 -triple i386-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free
-main-file-name MPS.ii -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-masm-verbose -target-cpu yonah -gdwarf-2 -coverage-file MPS.o -resource-dir
/Users/glider/src/asan-new-removeothers/llvm/llvm_cmake_build/bin/../lib/clang/3.4
-w -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir <cut> -ferror-limit
19 -fmessage-length 0 -fvisibility hidden -stack-protector 1 -mstackrealign
-fblocks -fno-rtti -fno-threadsafe-statics -fobjc-runtime=macosx-10.8.0
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fobjc-arc -fobjc-arc-cxxlib=libstdc++ -fobjc-arc-exceptions -fobjc-exceptions
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o MPS.o -x objective-c++ MPS.ii 
1.      MPS.ii:4:97: current parser token 'type'
2.      MPS.ii:3:30: parsing struct/union/class body '__pointer_type'
clang-3.4: error: unable to execute command: Illegal instruction: 4
clang-3.4: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (190520)
Target: i386-apple-darwin12.4.0
Thread model: posix
clang-3.4: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.4: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.4: note: diagnostic msg:
/var/folders/00/0k0r8000h01000cxqpysvccm002831/T/MPS-dd5fa6.mm
clang-3.4: note: diagnostic msg:
/var/folders/00/0k0r8000h01000cxqpysvccm002831/T/MPS-dd5fa6.sh
clang-3.4: note: diagnostic msg: 

********************


$ cat MPS.ii
      template <class _Tp>   typename remove_reference<int>  {
   }
        template <class _Tp> struct __pointer_type {
       typedef typename __pointer_type_imp::__pointer_type<int, typename
remove_reference<int>::type>::type type;
   };

-- 
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/20130911/7fc59eff/attachment.html>


More information about the llvm-bugs mailing list