<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - clang crashes on template instation"
href="http://llvm.org/bugs/show_bug.cgi?id=16259">16259</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes on template instation
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>a.bataev@gmx.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=10641" name="attach_10641" title="preprocessed source and associated run script">attachment 10641</a> <a href="attachment.cgi?id=10641&action=edit" title="preprocessed source and associated run script">[details]</a></span>
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
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>