[LLVMbugs] [Bug 10849] New: Failed assertion: `!SpecializedTemplate.is<SpecializedPartialSpecialization*>() && "Already set to a class template partial specialization!"'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 2 15:41:40 PDT 2011


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

           Summary: Failed assertion:
                    `!SpecializedTemplate.is<SpecializedPartialSpecializat
                    ion*>() && "Already set to a class template partial
                    specialization!"'
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pipping at exherbo.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=7211)
 --> (http://llvm.org/bugs/attachment.cgi?id=7211)
delta-reduced input (not valid code but manages to make clang++ crash)

% clang++ -c spec_tree-sRt9vh.ii
spec_tree-sRt9vh.ii:1:19: warning: variadic templates are a C++0x extension
[-Wc++0x-extensions]
template <typename...>
                  ^
spec_tree-sRt9vh.ii:10:18: error: implicit instantiation of undefined template
'MakeTypeList<int>'
typedef SpecTree<MakeTypeList<int>::Type> LicenseSpecTree;
                 ^
spec_tree-sRt9vh.ii:5:8: note: template is declared here
struct MakeTypeList<H_>;
       ^
clang:
/var/tmp/paludis/build/dev-lang-llvm-scm/work/llvm-scm/tools/clang/lib/Sema/../../include/clang/AST/DeclTemplate.h:1482:
void
clang::ClassTemplateSpecializationDecl::setInstantiationOf(clang::ClassTemplatePartialSpecializationDecl*,
clang::TemplateArgumentList*): Assertion
`!SpecializedTemplate.is<SpecializedPartialSpecialization*>() && "Already set
to a class template partial specialization!"' failed.
0  libLLVM-3.0svn.so 0x00007fd53204d6af
1  libLLVM-3.0svn.so 0x00007fd53204de10
2  libpthread.so.0   0x00007fd531016f10
3  libc.so.6         0x00007fd5303355c5 gsignal + 53
4  libc.so.6         0x00007fd5303368c5 abort + 389
5  libc.so.6         0x00007fd53032e235 __assert_fail + 245
6  clang             0x0000000000aab5c0
clang::ClassTemplateSpecializationDecl::setInstantiationOf(clang::ClassTemplatePartialSpecializationDecl*,
clang::TemplateArgumentList*) + 68
7  clang             0x0000000000a99556
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 2760
8  clang             0x0000000000ad2781
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::PartialDiagnostic const&, std::pair<clang::SourceLocation,
clang::PartialDiagnostic>) + 327
9  clang             0x0000000000ad3e43
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::PartialDiagnostic const&) + 53
10 clang             0x00000000008755ce
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*) + 638
11 clang             0x00000000008d17fc
clang::Sema::getTypeName(clang::IdentifierInfo&, clang::SourceLocation,
clang::Scope*, clang::CXXScopeSpec*, bool, bool,
clang::OpaquePtr<clang::QualType>, bool) + 422
12 clang             0x0000000000801b81
clang::Parser::TryAnnotateTypeOrScopeToken(bool) + 1857
13 clang             0x00000000007f412d
clang::Parser::isCXXDeclarationSpecifier() + 311
14 clang             0x00000000007f6b36
clang::Parser::isCXXTypeId(clang::Parser::TentativeCXXTypeIdContext, bool&) +
46
15 clang             0x00000000007f0140 clang::Parser::ParseTemplateArgument()
+ 32
16 clang             0x00000000007f225d
clang::Parser::ParseTemplateArgumentList(llvm::SmallVector<clang::ParsedTemplateArgument,
16u>&) + 65
17 clang             0x00000000007f2650
clang::Parser::ParseTemplateIdAfterTemplateName(clang::OpaquePtr<clang::TemplateName>,
clang::SourceLocation, clang::CXXScopeSpec const&, bool,
clang::SourceLocation&, llvm::SmallVector<clang::ParsedTemplateArgument, 16u>&,
clang::SourceLocation&) + 316
18 clang             0x00000000007f2e5f
clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr<clang::TemplateName>,
clang::TemplateNameKind, clang::CXXScopeSpec&, clang::UnqualifiedId&,
clang::SourceLocation, bool) + 249
19 clang             0x000000000083e02d
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool) + 6985
20 clang             0x00000000008291a3
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 1129
21 clang             0x00000000008174a8
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 5786
22 clang             0x00000000007ebf75
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier) + 889
23 clang             0x00000000007f09a1
clang::Parser::ParseExplicitInstantiation(clang::SourceLocation,
clang::SourceLocation, clang::SourceLocation&) + 91
24 clang             0x00000000007f0cc3
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier) + 765
25 clang             0x000000000081809f
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 191
26 clang             0x00000000007ff8c0
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1684
27 clang             0x000000000080037f
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 253
28 clang             0x00000000007d2c10 clang::ParseAST(clang::Sema&, bool) +
308
29 clang             0x0000000000593c74
clang::ASTFrontendAction::ExecuteAction() + 200
30 clang             0x0000000000689d89 clang::CodeGenAction::ExecuteAction() +
2691
31 clang             0x0000000000594213 clang::FrontendAction::Execute() + 389
32 clang             0x0000000000581420
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 868
33 clang             0x00000000005680bd
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3805
34 clang             0x000000000055eede cc1_main(char const**, char const**,
char const*, void*) + 7074
35 clang             0x0000000000565068 main + 751
36 libc.so.6         0x00007fd530321c7d __libc_start_main + 253
37 clang             0x000000000055d169
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name spec_tree-sRt9vh.ii
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.21.1
-momit-leaf-frame-pointer -coverage-file spec_tree-sRt9vh.o -resource-dir
/usr/bin/../lib/clang/3.0 -fdeprecated-macro -ferror-limit 19 -fmessage-length
238 -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-o spec_tree-sRt9vh.o -x c++-cpp-output spec_tree-sRt9vh.ii 
1.      spec_tree-sRt9vh.ii:13:35: current parser token 'Type'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.
%

-- 
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