[LLVMbugs] [Bug 16259] New: clang crashes on template instation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 7 02:55:19 PDT 2013


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

            Bug ID: 16259
           Summary: clang crashes on template instation
           Product: clang
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: a.bataev at gmx.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10641
  --> http://llvm.org/bugs/attachment.cgi?id=10641&action=edit
preprocessed source and associated run script

The following code crashes clang:

template <class T, class A>
void f() {
  T *q;
  q->A::~A();
}

class Q {};
int main() {
  f<Q, int>();
}


Assertion failed: (Tag && "Non-tag type in nested-name-specifier"), function
computeDeclContext, file /llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp, line
145.
0  clang             0x000000010e042abe llvm::sys::PrintStackTrace(__sFILE*) +
46
1  clang             0x000000010e042dcb PrintStackTraceSignalHandler(void*) +
27
2  clang             0x000000010e0430d9 SignalHandler(int) + 297
3  libsystem_c.dylib 0x00007fff950ef8ea _sigtramp + 26
4  libsystem_c.dylib 0x00007fff542e33e8 _sigtramp + 3206495000
5  clang             0x000000010e042dfb raise + 27
6  clang             0x000000010e042eb2 abort + 18
7  clang             0x000000010e042e91 __assert_rtn + 129
8  clang             0x000000010befc837
clang::Sema::computeDeclContext(clang::CXXScopeSpec const&, bool) + 1255
9  clang             0x000000010c185d76 LookupMemberExprInRecord(clang::Sema&,
clang::LookupResult&, clang::SourceRange, clang::RecordType const*,
clang::SourceLocation, clang::CXXScopeSpec&, bool) + 470
10 clang             0x000000010c1868a7
clang::Sema::LookupMemberExpr(clang::LookupResult&,
clang::ActionResult<clang::Expr*, true>&, bool&, clang::SourceLocation,
clang::CXXScopeSpec&, clang::Decl*, bool) + 1303
11 clang             0x000000010c1859a3
clang::Sema::BuildMemberReferenceExpr(clang::Expr*, clang::QualType,
clang::SourceLocation, bool, clang::CXXScopeSpec&, clang::SourceLocation,
clang::NamedDecl*, clang::DeclarationNameInfo const&,
clang::TemplateArgumentListInfo const*) + 819
12 clang             0x000000010c36040a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::RebuildCXXPseudoDestructorExpr(clang::Expr*,
clang::SourceLocation, bool, clang::CXXScopeSpec&, clang::TypeSourceInfo*,
clang::SourceLocation, clang::SourceLocation,
clang::PseudoDestructorTypeStorage) + 986
13 clang             0x000000010c34fd64 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCXXPseudoDestructorExpr(clang::CXXPseudoDestructorExpr*)
+ 1732
14 clang             0x000000010c3429a6 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 1238
15 clang             0x000000010c35f573 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCallExpr(clang::CallExpr*) + 83
16 clang             0x000000010c3508c2 (anonymous
namespace)::TemplateInstantiator::TransformCallExpr(clang::CallExpr*) + 66
17 clang             0x000000010c342afd clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*) + 1581
18 clang             0x000000010c342193 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 1827
19 clang             0x000000010c359ffd clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) + 173
20 clang             0x000000010c362d0a clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
+ 42
21 clang             0x000000010c341c68 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) + 504
22 clang             0x000000010c341a45 clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) + 133
23 clang             0x000000010c38a4a3
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) + 2307
24 clang             0x000000010c38b651
clang::Sema::PerformPendingInstantiations(bool) + 753
25 clang             0x000000010bed1727
clang::Sema::ActOnEndOfTranslationUnit() + 631
26 clang             0x000000010be56a1c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 348
27 clang             0x000000010bdd49ad clang::ParseAST(clang::Sema&, bool,
bool) + 541
28 clang             0x000000010b9fb2f8
clang::ASTFrontendAction::ExecuteAction() + 312
29 clang             0x000000010bd407a2 clang::CodeGenAction::ExecuteAction() +
1266
30 clang             0x000000010b9fae6f clang::FrontendAction::Execute() + 191
31 clang             0x000000010b9bbb60
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 896
32 clang             0x000000010b929504
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1028
33 clang             0x000000010b9154e7 cc1_main(char const**, char const**,
char const*, void*) + 711
34 clang             0x000000010b921d8a main + 490
35 libdyld.dylib     0x00007fff97da27e1 start + 0
Stack dump:
0.      Program arguments: /build/Debug+Asserts/bin/clang -cc1 -triple
x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -main-file-name
cxxc_bugs2062.cxx -mrelocation-model pic -pic-level 2 -mdisable-fp-elim
-masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 136
-resource-dir /build/Debug+Asserts/bin/../lib/clang/3.4 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 157
-stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.8.0
-fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties
-fencode-extended-block-signature -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o /var/folders/zz/zyxvpxvq6csfxvn_n01bj6140_w9h9/T/cxxc_bugs2062-Fe954P.o -x
c++ cxxc_bugs2062.cxx
1.      <eof> parser at end of file
2.      cxxc_bugs2062.cxx:3:6: instantiating function definition 'f'
clang: error: unable to execute command: Illegal instruction: 4
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 183484)
Target: x86_64-apple-darwin12.2.0
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:
/var/folders/zz/zyxvpxvq6csfxvn_n01bj6140_w9h9/T/cxxc_bugs2062-4Acqnm.cpp
clang: note: diagnostic msg:
/var/folders/zz/zyxvpxvq6csfxvn_n01bj6140_w9h9/T/cxxc_bugs2062-4Acqnm.sh
clang: note: diagnostic msg:

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


Alexey Bataev
Software Engineer
Intel Compiler Team
Intel Corp.

-- 
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/20130607/ac9b0d29/attachment.html>


More information about the llvm-bugs mailing list