[LLVMbugs] [Bug 12179] New: clang++ crash (ICE) on C++11 code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 4 09:25:54 PST 2012


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

             Bug #: 12179
           Summary: clang++ crash (ICE) on C++11 code
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm at safetymail.info
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


ICE on valid (at least compiles w/ g++) C++11 code.

---- 8< -------------
template <typename... T> struct List;
template <typename Primitive, template <Primitive...> class F>
struct unbox_args {
        template <typename L, typename PL>
        struct get_primitives_ : get_primitives_<typename L::tail, typename
PL::template add<L::head::val>::res> { };
        template <typename PL>
        struct get_primitives_<List<>, PL> { typedef PL res; };

        template <typename... Args>
        struct resx : get_primitives_<List<Args...>, int>::res::template
call<F> { };
};
---- >8 -------------

Compiler output:

0  libLLVM-3.0.so.1 0x00002b7701e8fadf
1  libLLVM-3.0.so.1 0x00002b7701e90081
2  libpthread.so.0  0x00002b77027b1030
3  libLLVM-3.0.so.1 0x00002b7701e7d228
llvm::FoldingSetImpl::InsertNode(llvm::FoldingSetImpl::Node*, void*) + 56
4  clang            0x0000000000cce2ee
clang::ASTContext::getDependentTemplateSpecializationType(clang::ElaboratedTypeKeyword,
clang::NestedNameSpecifier*, clang::IdentifierInfo const*, unsigned int,
clang::TemplateArgument const*) const + 1294
5  clang            0x0000000000cce23e
clang::ASTContext::getDependentTemplateSpecializationType(clang::ElaboratedTypeKeyword,
clang::NestedNameSpecifier*, clang::IdentifierInfo const*, unsigned int,
clang::TemplateArgument const*) const + 1118
6  clang            0x0000000000ccee3b
clang::ASTContext::getDependentTemplateSpecializationType(clang::ElaboratedTypeKeyword,
clang::NestedNameSpecifier*, clang::IdentifierInfo const*,
clang::TemplateArgumentListInfo const&) const + 379
7  clang            0x0000000000a04694
clang::Sema::ActOnTemplateIdType(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::TemplateName>, clang::SourceLocation,
clang::SourceLocation, clang::ASTTemplateArgsPtr, clang::SourceLocation) + 964
8  clang            0x00000000007e8e9c
clang::Parser::AnnotateTemplateIdTokenAsType() + 76
9  clang            0x000000000081361a
clang::Parser::ParseClassName(clang::SourceLocation&, clang::CXXScopeSpec&) +
2122
10 clang            0x0000000000813736
clang::Parser::ParseBaseSpecifier(clang::Decl*) + 182
11 clang            0x0000000000813994
clang::Parser::ParseBaseClause(clang::Decl*) + 116
12 clang            0x000000000081ac03
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 2627
13 clang            0x000000000081bc8b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 3275
14 clang            0x000000000080a6b1
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 593
15 clang            0x0000000000817c4e
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 862
16 clang            0x00000000007e7cb2
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier, clang::AttributeList*) + 3250
17 clang            0x00000000007eaa70
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 608
18 clang            0x00000000007eb4a7
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 103
19 clang            0x0000000000818ca9
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject*) + 5049
20 clang            0x000000000081a8ff
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 1855
21 clang            0x000000000081bc8b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 3275
22 clang            0x000000000080a6b1
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 593
23 clang            0x00000000007e7305
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier, clang::AttributeList*) + 773
24 clang            0x00000000007eaa70
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 608
25 clang            0x00000000007eb4a7
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*) + 103
26 clang            0x000000000080c8e4
clang::Parser::ParseDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&) + 596
27 clang            0x00000000007f763d
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 1037
28 clang            0x00000000007f8217
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 167
29 clang            0x00000000007cfa1d clang::ParseAST(clang::Sema&, bool) +
269
30 clang            0x00000000006b9093 clang::CodeGenAction::ExecuteAction() +
51
31 clang            0x00000000005c121f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 319
32 clang            0x00000000005a9a8a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1114
33 clang            0x00000000005a17a4 cc1_main(char const**, char const**,
char const*, void*) + 804
34 clang            0x00000000005a0154 main + 596
35 libc.so.6        0x00002b770358bead __libc_start_main + 253
36 clang            0x00000000005a1329
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
clang-ice.C -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -momit-leaf-frame-pointer -g -coverage-file clang-ice.o -resource-dir
/usr/bin/../lib/clang/3.0 -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem /usr/include/c++/4.6 -internal-isystem
/usr/include/c++/4.6/x86_64-linux-gnu -internal-isystem
/usr/include/c++/4.6/backward -internal-isystem /usr/local/include
-internal-isystem /usr/bin/../lib/clang/3.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /usr/include -Wall -W
-std=c++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -o clang-ice.o -x c++
clang-ice.C 
1.      clang-ice.C:10:58: at annotation token 
2.      clang-ice.C:3:1: parsing struct/union/class body 'unbox_args'
3.      clang-ice.C:10:2: parsing struct/union/class body 'resx'
clang: error: unable to execute command: Segmentation fault (core dumped)
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: Preprocessed source(s) are located at:
clang: note: diagnostic msg: /tmp/clang-ice-NcLxcG.ii

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