summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/conditional-expr.m
Commit message (Collapse)AuthorAgeFilesLines
* Improve the Objective-C common-type computation used by the ternary operator.Douglas Gregor2015-07-071-0/+11
| | | | | | | | | | | | | | | | The Objective-C common-type computation had a few problems that required a significant rework, including: - Quadradic behavior when finding the common base type; now it's linear. - Keeping around type arguments when computing the common type between a specialized and an unspecialized type - Introducing redundant protocol qualifiers. Part of rdar://problem/6294649. Also fixes rdar://problem/19572837 by addressing a longstanding bug in ASTContext::CollectInheritedProtocols(). llvm-svn: 241544
* Objective-C [Sema]. Fixes a bug in comparing qualifiedFariborz Jahanian2014-10-131-5/+5
| | | | | | | | Objective-C pointer types. In this case, checker incorrectly claims incompatible pointer types if redundant protocol conformance is specified. rdar://18491222 llvm-svn: 219630
* Objective-C. Patch to warn if the result of calling a property getter Fariborz Jahanian2014-07-181-2/+2
| | | | | | | | is unused (this is match behavior when property-dot syntax is used to use same getter). rdar://17514245 Patch by Anders Carlsson with minor refactoring by me. llvm-svn: 213423
* improve of note message and minor refactoring of my lastFariborz Jahanian2013-05-151-1/+1
| | | | | | patch (r181847). llvm-svn: 181896
* Objective-C [diagnostics] [QOI], when method is notFariborz Jahanian2013-05-141-1/+2
| | | | | | | | found for a receiver, note where receiver class is declaraed (this is most common when receiver is a forward class). // rdar://3258331 llvm-svn: 181847
* Split "incomplete implementation" warnings for ObjC into separate warnings.Ted Kremenek2013-03-271-2/+2
| | | | | | | | | | | | Previously all unimplemented methods for a class were grouped under a single warning, with all the unimplemented methods mentioned as notes. Based on feedback from users, most users would like a separate warning for each method, with a note pointing back to the original method declaration. Implements <rdar://problem/13350414> llvm-svn: 178097
* Added a new attribute, objc_root_class, which informs the compiler when a ↵Patrick Beard2012-04-061-1/+1
| | | | | | | | | root class is intentionally declared. The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698> llvm-svn: 154187
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Improve diagnostics when we fail to convert from a source type to aDouglas Gregor2010-04-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | destination type for initialization, assignment, parameter-passing, etc. The main issue fixed here is that we used rather confusing wording for diagnostics such as t.c:2:9: warning: initializing 'char const [2]' discards qualifiers, expected 'char *' [-pedantic] char *name = __func__; ^ ~~~~~~~~ We're not initializing a 'char const [2]', we're initializing a 'char *' with an expression of type 'char const [2]'. Similar problems existed for other diagnostics in this area, so I've normalized them all with more precise descriptive text to say what we're initializing/converting/assigning/etc. from and to. The warning for the code above is now: t.c:2:9: warning: initializing 'char *' from an expression of type 'char const [2]' discards qualifiers [-pedantic] char *name = __func__; ^ ~~~~~~~~ Fixes <rdar://problem/7447179>. llvm-svn: 100832
* Improve diagnostics on incomplete implementationFariborz Jahanian2010-03-271-2/+2
| | | | | | | | of objc classes; including which methods need be implemented and where they come from. WIP. llvm-svn: 99724
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Change tests to use clang -cc1...Fariborz Jahanian2009-12-141-1/+1
| | | | llvm-svn: 91297
* Remove a bunch of FIXME's related to ObjC type checking.Steve Naroff2009-07-231-5/+3
| | | | | | | | - Move Sema::ObjCQualifiedIdTypesAreCompatible(), Sema::QualifiedIdConformsQualifiedId(), and a couple helper functions to ASTContext. - Change ASTContext::canAssignObjCInterfaces() to use ASTContext:: ObjCQualifiedIdTypesAreCompatible(). - Tweak several test cases to accommodate the new/improved type checking. llvm-svn: 76830
* Some more ?: for Obj-C tests.Daniel Dunbar2009-07-161-0/+27
| | | | llvm-svn: 76125
* Add more testing of ?: for Obj-C object types.Daniel Dunbar2009-07-161-0/+50
| | | | llvm-svn: 76108
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Finish up some fixes related to <rdar://problem/6497631> Message lookup is ↵Steve Naroff2009-03-041-1/+1
| | | | | | | | | sometimes different than gcc's. - Disallow casting 'super'. GCC allows this, however it doesn't make sense (super isn't an expression and the cast won't alter lookup/dispatch). - Tighten up lookup when messaging 'self'. llvm-svn: 66033
* Implement an important missing warning when a selectorFariborz Jahanian2009-03-031-1/+1
| | | | | | | is searched for in the global pool. It already uncovered a clang bug in message selection. llvm-svn: 65974
* Downgrade incompatibilities with objc qualified types (e.g. id <P>) to warnings.Steve Naroff2008-10-141-2/+2
| | | | | | Note: One day, we should consider moving the actual diags to ObjCQualifiedIdTypesAreCompatible(), since it has more information on the actual problem. GCC currently emits slightly more instructive errors for some cases involving protocols. I added a FIXME to the code. llvm-svn: 57529
* Improve type-checking of ?: for Objective-C types.Daniel Dunbar2008-09-031-2/+2
| | | | | | | - Allow any Objective-C object types to devolve to type id in a ?: expression. This matches gcc behavior more closely. llvm-svn: 55705
* move all objc sema tests into a new SemaObjC directory. Next step is toChris Lattner2008-07-261-0/+44
remove the objc- prefix from the tests that use it. llvm-svn: 54084
OpenPOWER on IntegriCloud