[LLVMbugs] [Bug 14458] New: Impossible TemplateArgument UNREACHABLE executed at llvm/tools/clang/lib/AST/TypeLoc.cpp:325!

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 29 16:18:46 PST 2012


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

             Bug #: 14458
           Summary: Impossible TemplateArgument UNREACHABLE executed at
                    llvm/tools/clang/lib/AST/TypeLoc.cpp:325!
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: snubdodecahedron at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang++ aborts on the following code:

template<class T,int d> class A {};
template<class T,int d> struct B;
template<class T> struct B<A<T,0>,0> { typedef int C;  };
template<class T> struct B<T,0> {  };
B<A<int,0>,0>::C b;

Compiled like this: clang++ -c prog.cpp

$ clang++ -v
clang version 3.3 (trunk 168824) (llvm/trunk 168819:168824)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Diagnostic:

Impossible TemplateArgument
UNREACHABLE executed at
/home/craig/llvm/llvm/tools/clang/lib/AST/TypeLoc.cpp:325!
0  clang           0x0000000001d7748f
1  clang           0x0000000001d77973
2  libpthread.so.0 0x00007fa3ca391cb0
3  libc.so.6       0x00007fa3c95e3425 gsignal + 53
4  libc.so.6       0x00007fa3c95e6b8b abort + 379
5  clang           0x0000000001d6551f llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 463
6  clang           0x000000000114b6ee
clang::TemplateSpecializationTypeLoc::initializeArgLocs(clang::ASTContext&,
unsigned int, clang::TemplateArgument const*, clang::TemplateArgumentLocInfo*,
clang::SourceLocation) + 430
7  clang           0x000000000114a4fa
clang::TypeLoc::initializeImpl(clang::ASTContext&, clang::TypeLoc,
clang::SourceLocation) + 1002
8  clang           0x000000000100aca2
clang::ASTContext::getTrivialTypeSourceInfo(clang::QualType,
clang::SourceLocation) const + 82
9  clang           0x0000000000bdb025
10 clang           0x0000000000bd8ca4
11 clang           0x0000000000be3cfa
clang::Sema::getMoreSpecializedPartialSpecialization(clang::ClassTemplatePartialSpecializationDecl*,
clang::ClassTemplatePartialSpecializationDecl*, clang::SourceLocation) + 1450
12 clang           0x0000000000c0a0b2
clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation,
clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind,
bool) + 978
13 clang           0x0000000000c52c6f
clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType,
clang::Sema::TypeDiagnoser&) + 735
14 clang           0x00000000009797c0
clang::Sema::RequireCompleteDeclContext(clang::CXXScopeSpec&,
clang::DeclContext*) + 256
15 clang           0x00000000009dec8b
clang::Sema::getTypeName(clang::IdentifierInfo&, clang::SourceLocation,
clang::Scope*, clang::CXXScopeSpec*, bool, bool,
clang::OpaquePtr<clang::QualType>, bool, bool, clang::IdentifierInfo**) + 203
16 clang           0x00000000008fd331
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4721
17 clang           0x00000000008f04b7
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 71
18 clang           0x00000000008f018d
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 333
19 clang           0x00000000008ef7ec
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 2396
20 clang           0x00000000008eee10
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 304
21 clang           0x00000000008eb166 clang::ParseAST(clang::Sema&, bool, bool)
+ 470
22 clang           0x00000000007b684c clang::CodeGenAction::ExecuteAction() +
204
23 clang           0x000000000065df7a clang::FrontendAction::Execute() + 106
24 clang           0x000000000064040d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 989
25 clang           0x0000000000626fa2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3618
26 clang           0x000000000061e426 cc1_main(char const**, char const**, char
const*, void*) + 774
27 clang           0x00000000006232fa main + 3482
28 libc.so.6       0x00007fa3c95ce76d __libc_start_main + 237
29 clang           0x000000000061e05d
Stack dump:
0.    Program arguments: /home/craig/bin/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
prog.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -momit-leaf-frame-pointer -coverage-file /home/craig/cc/prog.o
-resource-dir /home/craig/bin/bin/../lib/clang/3.3 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/home/craig/bin/bin/../lib/clang/3.3/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/craig/cc -ferror-limit 19 -fmessage-length 284
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o prog.o -x c++ prog.cpp 
1.    prog.cpp:5:1: at annotation token 
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (trunk 168824) (llvm/trunk 168819:168824)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: 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: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/prog-KPBtZP.cpp
clang: note: diagnostic msg: /tmp/prog-KPBtZP.sh
clang: note: diagnostic msg: 

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

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