<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 invalid code"
href="http://llvm.org/bugs/show_bug.cgi?id=19993">19993</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes on invalid code
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>llvm-bugs@skybert.org
</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=12634" name="attach_12634" title="the run script">attachment 12634</a> <a href="attachment.cgi?id=12634&action=edit" title="the run script">[details]</a></span>
the run script
This simple thing makes clang crash:
-----
class test
{
public:
static int bob = delete;
};
-----
Removing 'static' removes crash.
# clang++ -std=c++11 test.cpp
test.cpp:4:22: error: only functions can have deleted definitions
static int bob = delete;
^
clang: /home/build/rpmwork/BUILD/llvm-3.4/include/llvm/Support/Casting.h:97:
static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To =
clang::ParenListExpr; From = clang::Expr]: Assertion `Val && "isa<> used on a
null pointer"' failed.
0 clang 0x0000000001e50c62 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 clang 0x0000000001e50929
2 libpthread.so.0 0x00007ff6a554f7c0
3 libc.so.6 0x00007ff6a43f4b55 gsignal + 53
4 libc.so.6 0x00007ff6a43f6131 abort + 385
5 libc.so.6 0x00007ff6a43eda10 __assert_fail + 240
6 clang 0x0000000000aba8fb
clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool, bool) +
6251
7 clang 0x00000000009c5099
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) + 3081
8 clang 0x00000000009c70b1
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) + 1681
9 clang 0x00000000009c8ea7
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&) + 4519
10 clang 0x00000000009b0dba
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) + 4490
11 clang 0x000000000099e684
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier) + 84
12 clang 0x000000000099edb6
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier) + 1030
13 clang 0x00000000009a314a
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) + 330
14 clang 0x00000000009a36c5
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 181
15 clang 0x000000000099c320 clang::ParseAST(clang::Sema&, bool, bool)
+ 352
16 clang 0x0000000000811caf clang::CodeGenAction::ExecuteAction() +
79
17 clang 0x00000000006910d9 clang::FrontendAction::Execute() + 249
18 clang 0x00000000006708fa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 346
19 clang 0x0000000000659a79
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1785
20 clang 0x0000000000652598 cc1_main(char const**, char const**, char
const*, void*) + 984
21 clang 0x0000000000656ebc main + 700
22 libc.so.6 0x00007ff6a43e0c36 __libc_start_main + 230
23 clang 0x00000000006513e9
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-suse-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name test.cpp -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 11
-resource-dir /usr/bin/../lib/clang/3.4 -internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/x86_64-suse-linux
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/c++/4.9/backward
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-suse-linux/4.9/../../../../include/x86_64-suse-linux/c++/4.9
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.4/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir /home/magne/work/packages/meos-utils++/test
-ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -vectorize-slp -o
/tmp/test-e47058.o -x c++ test.cpp
1. test.cpp:4:28: current parser token ';'
2. test.cpp:1:1: parsing struct/union/class body 'test'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-suse-linux-gnu
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: /tmp/test-07fba5.cpp
clang: note: diagnostic msg: /tmp/test-07fba5.sh
clang: 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>