[cfe-dev] implemented a new switch, having trouble testing
Daniel DeCovnick
danhd123 at mac.com
Tue Mar 27 17:51:43 PDT 2012
There's been a lot of discussion lately on the Apple objc-language list about how it'd be nice if there was a compiler switch to specify what class should be used for numeric, array, and dictionary literals, similar to -fconstant-string-class. So I went ahead and implemented -fobjc-numeric-literal-class (with -fobjc-array-literal-class and -fobjc-dictionary-literal-class to come)
The diff: http://pastie.org/3663039
Or at least I think I did. I'm not sure, because I haven't been able to test it properly. I tried to write a test case in SemaObjC based on the objc-literal-nsnumber test:
http://pastie.org/3663058
but the test always fails, with this error:
"error: 'error' diagnostics seen but not expected:
(frontend): unknown argument: '-fobjc-numeric-literal-class=MYNumber'"
I also wrote a test program which seems to work correctly: http://pastie.org/3663088 (and gives the expected warning if I do @123.45 instead of @123.45f, as -numberWithDouble: isn't implemented on MYNumber)
Can someone help me get the test working, and then what's the process for getting a patch like this sent upstream (once I've got the array and dictionary literals done)?
-Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120327/05bd4cf6/attachment.html>
More information about the cfe-dev
mailing list