<html>
<head>
<base href="https://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 --- - PPCaching.cpp:109 assert can be triggered by invalid code"
href="https://llvm.org/bugs/show_bug.cgi?id=25946">25946</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>PPCaching.cpp:109 assert can be triggered by invalid code
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>bero@linaro.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Trying to build this code snippet with clang 3.7 causes a crash on an assert:
template < T >
class A
template < typename T >
class B: T
A < >
No optimization flags etc. needed.
The error is:
compress-5eaa12.cpp:1:13: error: unknown type name 'T'
template < T >
^
compress-5eaa12.cpp:2:10: error: expected ';' after class
class A
^
;
clang-3.7: ../tools/clang/lib/Lex/PPCaching.cpp:109: void
clang::Preprocessor::AnnotatePreviousCachedTokens(const clang::Token &):
Assertion `(BacktrackPositions.empty() || BacktrackPositions.back() < i) &&
"The backtrack pos points inside the annotated tokens!"' failed.
#0 0x3a2d496173 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/lib64/libLLVMSupport.so.3.7+0x3a2d496173)
#1 0x3a2d496f75 (/usr/lib64/libLLVMSupport.so.3.7+0x3a2d496f75)
#2 0x37d322f7f0 __restore_rt (/lib64/libc.so.6+0x37d322f7f0)
#3 0x37d322f7a3 __GI_raise (/lib64/libc.so.6+0x37d322f7a3)
#4 0x37d32306c2 __GI_abort (/lib64/libc.so.6+0x37d32306c2)
#5 0x37d3229e62 __GI___assert_fail (/lib64/libc.so.6+0x37d3229e62)
#6 0x37d3229ea6 __GI___assert_perror_fail (/lib64/libc.so.6+0x37d3229ea6)
#7 0x3a3603fc21 (/usr/lib64/libclangLex.so.3.7+0x3a3603fc21)
#8 0x3a3bc84cc0
clang::Parser::AnnotateTemplateIdToken(clang::OpaquePtr<clang::TemplateName>,
clang::TemplateNameKind, clang::CXXScopeSpec&, clang::SourceLocation,
clang::UnqualifiedId&, bool) (/usr/lib64/libclangParse.so.3.7+0x3a3bc84cc0)
#9 0x3a3bc5e30a
clang::Parser::ParseOptionalCXXScopeSpecifier(clang::CXXScopeSpec&,
clang::OpaquePtr<clang::QualType>, bool, bool*, bool, clang::IdentifierInfo**)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc5e30a)
#10 0x3a3bc39bc7 clang::Parser::isConstructorDeclarator(bool)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc39bc7)
#11 0x3a3bc48e35
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) (/usr/lib64/libclangParse.so.3.7+0x3a3bc48e35)
#12 0x3a3bc47768 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc47768)
#13 0x3a3bc34101 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc34101)
#14 0x3a3bc82930 clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned
int, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc82930)
#15 0x3a3bc825d4
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc825d4)
#16 0x3a3bc82137 clang::Parser::ParseDeclarationStartingWithTemplate(unsigned
int, clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc82137)
#17 0x3a3bc33927 clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc33927)
#18 0x3a3bc895d6
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/lib64/libclangParse.so.3.7+0x3a3bc895d6)
#19 0x3a3bc8945d
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc8945d)
#20 0x3a3bc29e07 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/lib64/libclangParse.so.3.7+0x3a3bc29e07)
#21 0x3a3c973577 clang::CodeGenAction::ExecuteAction()
(/usr/lib64/libclangCodeGen.so.3.7+0x3a3c973577)
#22 0x3a3c08ad69 clang::FrontendAction::Execute()
(/usr/lib64/libclangFrontend.so.3.7+0x3a3c08ad69)
#23 0x3a3c06a930 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/lib64/libclangFrontend.so.3.7+0x3a3c06a930)
#24 0x3a3a802de4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/lib64/libclangFrontendTool.so.3.7+0x3a3a802de4)
#25 0x40f04e cc1_main(llvm::ArrayRef<char const*>, char const*, void*)
(/usr/bin/clang-3.7+0x40f04e)
#26 0x40bdb7 main (/usr/bin/clang-3.7+0x40bdb7)
#27 0x37d3220efc __libc_start_main (/lib64/libc.so.6+0x37d3220efc)
#28 0x40b8a9 _start (/usr/bin/clang-3.7+0x40b8a9)
Stack dump:
0. Program arguments: /usr/bin/clang-3.7 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
compress-5eaa12.cpp -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-coverage-file /home/bero/Downloads/compress-5eaa12.cpp -resource-dir
/usr/bin/../lib64/clang/3.7.0 -internal-isystem
/usr/bin/../lib64/gcc/x86_64-mandriva-linux-gnu/5.3.1/../../../../include/c++/5.3.1
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-mandriva-linux-gnu/5.3.1/../../../../include/c++/5.3.1/x86_64-mandriva-linux-gnu
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-mandriva-linux-gnu/5.3.1/../../../../include/c++/5.3.1/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib64/clang/3.7.0/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/bero/Downloads -ferror-limit 19 -fmessage-length
142 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o compress-5eaa12.o -x c++
compress-5eaa12.cpp
1. compress-5eaa12.cpp:5:3: at annotation token
2. compress-5eaa12.cpp:4:3: parsing struct/union/class body 'B'
clang-3.7: error: unable to execute command: Aborted (core dumped)
clang-3.7: error: clang frontend command failed due to signal (use -v to see
invocation)
The code was generated while running creduce on the sample in <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Assertion `Type == RT64_32' failed while building Qt 5.6.0-beta"
href="show_bug.cgi?id=25944">bug 25944</a> with an
oversimplified script (that just checked for "Assertion.*failed"), but it looks
like this is actually a separate issue.</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>