Compiler crashes when compiling a particular expression as Obj-C++
| Originator: | mike.ferenduros | ||
| Number: | rdar://15217078 | Date Originated: | 13-Oct-2013 04:48 PM |
| Status: | Closed | Resolved: | Yes |
| Product: | Developer Tools | Product Version: | |
| Classification: | Reproducible: | Always |
Summary:
The following code compiles fine as Obj-C. When compiling as Obj-C++, it segfaults the compiler.
NSDictionary *dict = @{}
id a = dict[@"one"] ?: dict[@"two"]
Steps to Reproduce:
Install XCode
Try and compile the attached test.mm as follows
clang test.mm
Expected Results:
I'd expect the compiler not to crash
Actual Results:
The compiler segfaults and asks me to file a bug.
Version:
XCode Version 5.0 (5A1412)
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.4.0
Thread model: posix
Notes:
Configuration:
Not configuration-dependent as far as I can tell.
Attachments:
'preprocessed.mm', 'build.sh' and 'test.mm' were successfully uploaded.
test.mm:
//Compiled with `clang test.mm`
//Compiling as test.m -> works fine
#import <Foundation/Foundation.h>
id crashes( NSDictionary *dict )
{
return dict[@"one"] ?: dict[@"two"];
}
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!