<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 --- - crash on invalid Cls<T>::(value) assertion !EnteredScope && "Already entered the scope!""
href="http://llvm.org/bugs/show_bug.cgi?id=19683">19683</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>crash on invalid Cls<T>::(value) assertion !EnteredScope && "Already entered the scope!"
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nlewycky@google.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>Testcase:
template<typename> class Cls;
template<typename T> Cls<T>::(value);
Also note similar <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Error recovery can trigger Assertion `!EnteredScope && "Already entered the scope!"'"
href="show_bug.cgi?id=12809">bug 12809</a> which may be related but doesn't have the '::('
construct which is where I think the extra scope is.
Crash:
$ gdb --args clang -cc1 x.ii
(gdb) run
Starting program: /usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang
-cc1 x.ii
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/grte/v3/lib64/libthread_db.so.1".
clang:
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h:2163:
void clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope(): Assertion
`!EnteredScope && "Already entered the scope!"' failed.
Program received signal SIGABRT, Aborted.
0x00007ffff6ced425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6ced425 in __GI_raise (sig=<optimized out>) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6cf0b8b in __GI_abort () at abort.c:91
#2 0x00007ffff6ce60ee in __assert_fail_base (fmt=<optimized out>,
assertion=0x3d050e8 "!EnteredScope && \"Already entered the scope!\"",
file=0x3d04e78
"/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h",
line=<optimized out>, function=<optimized out>) at assert.c:94
#3 0x00007ffff6ce6192 in __GI___assert_fail (assertion=0x3d050e8
"!EnteredScope && \"Already entered the scope!\"", file=0x3d04e78
"/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h",
line=2163, function=0x3d0a4e0
<clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope()::__PRETTY_FUNCTION__>
"void clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope()") at
assert.c:103
#4 0x000000000151ebee in
clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope (this=0x7fffffffb0b0)
at
/usr/local/google/home/nlewycky/llvm/tools/clang/lib/Parse/../../include/clang/Parse/Parser.h:2163
#5 0x000000000153002e in clang::Parser::ParseDirectDeclarator (this=0x61b0110,
D=...) at ParseDecl.cpp:4820
#6 0x000000000152ecc4 in clang::Parser::ParseDeclaratorInternal
(this=0x61b0110, D=..., DirectDeclParser=(void (clang::Parser::*)(clang::Parser
* const, clang::Declarator &)) 0x152f6da
<clang::Parser::ParseDirectDeclarator(clang::Declarator&)>) at
ParseDecl.cpp:4527
#7 0x000000000152ea0c in clang::Parser::ParseDeclarator (this=0x61b0110,
D=...) at ParseDecl.cpp:4463
#8 0x00000000015829de in clang::Parser::ParseSingleDeclarationAfterTemplate
(this=0x61b0110, Context=0, TemplateInfo=..., DiagsFromTParams=...,
DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at ParseTemplate.cpp:210
#9 0x0000000001582630 in
clang::Parser::ParseTemplateDeclarationOrSpecialization (this=0x61b0110,
Context=0, DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at
ParseTemplate.cpp:145
#10 0x000000000158224b in clang::Parser::ParseDeclarationStartingWithTemplate
(this=0x61b0110, Context=0, DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at
ParseTemplate.cpp:39
#11 0x0000000001524a56 in clang::Parser::ParseDeclaration (this=0x61b0110,
Stmts=..., Context=0, DeclEnd=..., attrs=...) at ParseDecl.cpp:1298
#12 0x000000000151374c in clang::Parser::ParseExternalDeclaration
(this=0x61b0110, attrs=..., DS=0x0) at Parser.cpp:699
#13 0x000000000151301c in clang::Parser::ParseTopLevelDecl (this=0x61b0110,
Result=...) at Parser.cpp:557
#14 0x000000000150c48c in clang::ParseAST (S=..., PrintStats=false,
SkipFunctionBodies=false) at ParseAST.cpp:145
#15 0x00000000010140be in clang::ASTFrontendAction::ExecuteAction
(this=0x614d0e0) at FrontendAction.cpp:487
#16 0x0000000001013bf3 in clang::FrontendAction::Execute (this=0x614d0e0) at
FrontendAction.cpp:388
#17 0x0000000000fe1c9e in clang::CompilerInstance::ExecuteAction
(this=0x614c360, Act=...) at CompilerInstance.cpp:727
#18 0x0000000000fa8a66 in clang::ExecuteCompilerInvocation (Clang=0x614c360) at
ExecuteCompilerInvocation.cpp:239
#19 0x0000000000f9708d in cc1_main (ArgBegin=0x7fffffffd8d8,
ArgEnd=0x7fffffffd8e0, Argv0=0x7fffffffe7c0
"/usr/local/google/home/nlewycky/llvm/Debug+Asserts/bin/clang",
MainAddr=0xfa214e <GetExecutablePath(char const*, bool)>) at cc1_main.cpp:112
#20 0x0000000000fa362f in main (argc_=3, argv_=0x7fffffffe498) at
driver.cpp:319</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>