<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 --- - Assertion failed: (T::isKind(*this)), function castAs, file tools/clang/include/clang/AST/TypeLoc.h, line 54."
href="http://llvm.org/bugs/show_bug.cgi?id=18633">18633</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failed: (T::isKind(*this)), function castAs, file tools/clang/include/clang/AST/TypeLoc.h, line 54.
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dimitry@andric.com
</td>
</tr>
<tr>
<th>CC</th>
<td>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=11951" name="attach_11951" title="Test case for quantis typeloc assertion failure">attachment 11951</a> <a href="attachment.cgi?id=11951&action=edit" title="Test case for quantis typeloc assertion failure">[details]</a></span>
Test case for quantis typeloc assertion failure
Koop Mast (<a href="mailto:kwm@FreeBSD.org">kwm@FreeBSD.org</a>) pointed me at the following clang assertion in a
build log for the Quantis port:
<a href="http://beefy1.isc.freebsd.org/bulk/head-i386-default/2014-01-23_09h31m52s/logs/quantis-v13.04.29.log">http://beefy1.isc.freebsd.org/bulk/head-i386-default/2014-01-23_09h31m52s/logs/quantis-v13.04.29.log</a>
This turns out to be some weird parser problem, which only occurs when
assertions are enabled. Thanks to creduce, I was able to reduce this to a 527
byte test case.
Simply compile with clang -c, which will produce a lot of (uninteresting)
errors, then die with:
Assertion failed: (T::isKind(*this)), function castAs, file
tools/clang/include/clang/AST/TypeLoc.h, line 54.
Stack dump:
0. Program arguments: clang -cc1 -triple i386-unknown-freebsd11.0
-emit-obj -mrelax-all -disable-free -main-file-name quantis-reduced.cpp
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-target-cpu i486 -coverage-file quantis-reduced.o -internal-isystem
/usr/include/c++/v1 -w -fdeprecated-macro -ferror-limit 19 -fmessage-length 340
-mstackrealign -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-slp -o
quantis-reduced.o -x c++ quantis-reduced.cpp
1. <eof> parser at end of file
2. quantis-reduced.cpp:10:7: instantiating function definition
'GenerateFormattedFile'
The stack trace goes approximately like this:
#0 0x2a21b956 in __assert () from /lib/libc.so.7
#1 0x09747cde in clang::VariableArrayTypeLoc
clang::TypeLocBuilder::push<clang::VariableArrayTypeLoc>(clang::QualType) ()
#2 0x098b430e in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeLocBuilder&,
clang::TypeLoc) ()
#3 0x098b366c in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformType(clang::TypeSourceInfo*) ()
#4 0x098b3507 in clang::Sema::SubstType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName) ()
#5 0x098de43e in
clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*, bool) ()
#6 0x098de350 in
clang::TemplateDeclInstantiator::VisitVarDecl(clang::VarDecl*) ()
#7 0x098e6de8 in clang::Sema::SubstDecl(clang::Decl*, clang::DeclContext*,
clang::MultiLevelTemplateArgumentList const&) ()
#8 0x098d60c6 in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformDeclStmt(clang::DeclStmt*) ()
#9 0x098bdd40 in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) ()
#10 0x098d211b in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) ()
#11 0x098d5fc0 in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
()
#12 0x098bdd18 in clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*) ()
#13 0x098bdbad in clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&) ()
#14 0x098ec230 in
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool) ()
#15 0x098ed5d9 in clang::Sema::PerformPendingInstantiations(bool) ()
#16 0x0959b877 in clang::Sema::ActOnEndOfTranslationUnit() ()
#17 0x09418ab1 in
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) ()
#18 0x09414772 in clang::ParseAST(clang::Sema&, bool, bool) ()
#19 0x08dfa180 in clang::ASTFrontendAction::ExecuteAction() ()
#20 0x0922a473 in clang::CodeGenAction::ExecuteAction() ()
#21 0x08df9a9d in clang::FrontendAction::Execute() ()
#22 0x08dd738d in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#23 0x08e67a28 in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#24 0x0832099d in cc1_main(char const**, char const**, char const*, void*) ()
#25 0x0831e36a in main ()</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>