<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 --- - ICE on invalid code in clang::Parser::ParseLexedMethodDeclaration(clang::Parser::LateParsedMethodDeclaration&)"
href="https://llvm.org/bugs/show_bug.cgi?id=25161">25161</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE on invalid code in clang::Parser::ParseLexedMethodDeclaration(clang::Parser::LateParsedMethodDeclaration&)
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>miyuki-llvm@miyuki.ru
</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>Created <span class=""><a href="attachment.cgi?id=15065" name="attach_15065" title="Preprocessed source">attachment 15065</a> <a href="attachment.cgi?id=15065&action=edit" title="Preprocessed source">[details]</a></span>
Preprocessed source
The following invalid code causes an ICE:
$ cat test.cc
struct foo
{
foobar foo() throw() : t(0) { }
int t;
};
$ clang++ -c test.cc
test.cc:3:5: error: unknown type name 'foobar'
foobar foo() throw() : t(0) { }
^
test.cc:3:12: error: constructor cannot have a return type
foobar foo() throw() : t(0) { }
^~~
0 clang-3.8 0x00000000017adbc5
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 clang-3.8 0x00000000017ace36 llvm::sys::RunSignalHandlers() + 54
2 clang-3.8 0x00000000017ad025
3 libpthread.so.0 0x00007f0e9b7d98d0
4 clang-3.8 0x0000000002046ade
clang::Parser::ParseLexedMethodDeclaration(clang::Parser::LateParsedMethodDeclaration&)
+ 2094
5 clang-3.8 0x0000000002042616
clang::Parser::ParseLexedMethodDeclarations(clang::Parser::ParsingClass&) + 182
6 clang-3.8 0x00000000020726b2
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1234
7 clang-3.8 0x00000000020736e6
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 2374
8 clang-3.8 0x0000000002054fbe
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4814
9 clang-3.8 0x000000000203b184
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 84
10 clang-3.8 0x000000000203b889
11 clang-3.8 0x000000000203b8bf
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 31
12 clang-3.8 0x0000000002041a4f
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 255
13 clang-3.8 0x0000000002042220
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 384
14 clang-3.8 0x0000000002037370 clang::ParseAST(clang::Sema&, bool, bool)
+ 432
15 clang-3.8 0x0000000001b4f4c6 clang::FrontendAction::Execute() + 262
16 clang-3.8 0x0000000001b2e069
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 297
17 clang-3.8 0x0000000001bcb433
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1939
18 clang-3.8 0x0000000000867a20 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 2576
19 clang-3.8 0x0000000000828744 main + 5844
20 libc.so.6 0x00007f0e9aa05b45 __libc_start_main + 245
21 clang-3.8 0x0000000000865674
Stack dump:
0. Program arguments: /opt/clang-trunk/bin/clang-3.8 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.cc -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/miyuki/test/test.cc -resource-dir
/opt/clang-trunk/bin/../lib/clang/3.8.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/clang-trunk/bin/../lib/clang/3.8.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/miyuki/test -ferror-limit 19 -fmessage-length 237
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o test.o -x c++ test.cc
1. test.cc:3:18: current parser token 'throw'
2. test.cc:1:1: parsing struct/union/class body 'foo'
clang-3.8: error: unable to execute command: Segmentation fault
clang-3.8: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (trunk 250094)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/clang-trunk/bin
clang-3.8: 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-3.8: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.8: note: diagnostic msg: /tmp/test-892d95.cpp
clang-3.8: note: diagnostic msg: /tmp/test-892d95.sh
clang-3.8: note: diagnostic msg:
********************</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>