<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 --- - Segmentation fault on ambiguous constructor call in ObjC++ mode"
href="http://llvm.org/bugs/show_bug.cgi?id=18837">18837</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Segmentation fault on ambiguous constructor call in ObjC++ mode
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>warp.grrr@gmx.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>clang crashes with a segmentation fault when parsing an Objective-C++ file
(.mm) containing an ambiguous constructor call using an initializer list
syntax. (Curiously, it does not crash when compiling the same code in C++ mode,
instead giving the proper error message.)
Put the following code eg. in a test.mm file and then compile with
clang++ -std=c++11 test.mm
//--------------------------------------------
struct TestStruct { float x, y; };
class Test
{
public:
Test(TestStruct) {}
Test(float, float) {}
};
Test test({ 0, 0 });
//--------------------------------------------
Clang prints:
Stack dump:
0. Program arguments: (omitted here)
1. test.mm:12:24: current parser token ';'
2. test.mm:11:1: parsing function body 'foo'
3. test.mm:11:1: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
Confirmed to happen with:
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
and:
Debian clang version 3.3-16 (branches/release_33) (based on LLVM 3.3)
Target: x86_64-pc-linux-gnu
The full invocation in the former case (as reported by clang) is:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name test.mm -mrelocation-model pic
-pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2
-target-linker-version 224.1 -stdlib=libc++ -std=c++11 -fdeprecated-macro
-ferror-limit 19 -fmessage-length 80 -stack-protector 1 -mstackrealign -fblocks
-fobjc-runtime=macosx-10.9.0 -fobjc-dispatch-method=mixed
-fobjc-default-synthesize-properties -fencode-extended-block-signature
-fobjc-exceptions -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -x objective-c++ test-MNOZUN.mm</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>