Ted Kremenek
6cd0187718
Remove warning for null characters in CFString literals. Clang handles them just fine, and GCC 4.2 doesn't warn here either.
...
We added this warning back in 2007 when we were comparing against GCC 4.0.
llvm-svn: 127704
2011-03-15 21:18:52 +00:00
Fariborz Jahanian
b03a4c23c2
Don't poke into redefined 'id' type looking for a property
...
declaration as this results in a confusing error message,
instead of message related to missing property declaration.
// rdar://9106929
llvm-svn: 127682
2011-03-15 17:27:48 +00:00
Ted Kremenek
ea6c20adaf
Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users.
...
llvm-svn: 127670
2011-03-15 05:22:33 +00:00
Douglas Gregor
1e98986160
Disable 'auto' type deduction in Objective-C. It likes 'id' a bit too
...
much to be useful.
llvm-svn: 127625
2011-03-14 21:43:30 +00:00
Fariborz Jahanian
90186f8a3e
Block return type of the initialized must be
...
be more speciaclized than that of the initializer,
when matching protocol qualifier list.
// rdar:// 9118343.
llvm-svn: 127585
2011-03-14 16:07:00 +00:00
Fariborz Jahanian
c677f69397
Place duplicate argument declaration in in
...
method prototypes under the -Wduplicate-method-arg and
turn it off by default.
llvm-svn: 127552
2011-03-12 18:54:30 +00:00
Fariborz Jahanian
b296e330a3
Property setter/getter must be looked up in property type's
...
list of protocols as well. // rdar://9078584
llvm-svn: 127367
2011-03-09 22:17:12 +00:00
Fariborz Jahanian
3dc11ad796
Lookup selector in protocol list of qualified objc type
...
to avoid a bogus warning. // rdar:// 9072298
llvm-svn: 127355
2011-03-09 20:18:06 +00:00
Fariborz Jahanian
08891f5249
Warn on usage of unavailable objc 'class' in
...
varienty of cases. // rdar://9092208
llvm-svn: 127257
2011-03-08 19:12:46 +00:00
John McCall
462c055d85
Fix my earlier commit to work with escaped newlines and leave breadcrumbs
...
in case we want to make a world where we can check intermediate instantiations
for this kind of breadcrumb.
llvm-svn: 127221
2011-03-08 07:59:04 +00:00
John McCall
ed14ad24e0
objc_gc wants a pointer type, not a function type; give it a more appropriate
...
diagnostic. Also, these attributes are commonly written with macros which we
actually pre-define, so instead of expanding the macro location, refer to the
instantiation location and name it using the macro loc.
llvm-svn: 127219
2011-03-08 04:17:03 +00:00
Carl Norum
58d489fc6e
Fix tests to account for new warning "expected ';' at end of declaration list". Sorry, folks!
...
llvm-svn: 127188
2011-03-07 22:57:45 +00:00
John McCall
80ee5963fd
Pretty up the wrong-number-of-arguments-for-attribute diagnostic by
...
using a custom plural form. Split out the range diagnostics as their
own message.
llvm-svn: 126840
2011-03-02 12:15:05 +00:00
Argyrios Kyrtzidis
af181bb19b
Move test/SemaObjC/method-arg-decay.m -> test/Analysis/method-arg-decay.m
...
llvm-svn: 126675
2011-02-28 19:49:21 +00:00
Matt Beaumont-Gay
b7edc188e2
fix typo in *all* of the test cases
...
llvm-svn: 126328
2011-02-23 19:40:41 +00:00
Matt Beaumont-Gay
006cdae008
fix typo in test too
...
llvm-svn: 126327
2011-02-23 19:39:05 +00:00
Fariborz Jahanian
bb6db56028
Provide Fixit warning when 'auto' is intended as storage
...
specifier in legacy code. Patch is reviewed offline by Doug.
// rdar://9036633.
llvm-svn: 126261
2011-02-22 23:17:49 +00:00
Anders Carlsson
3320e1575f
Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.
...
Update all tests accordingly.
llvm-svn: 126177
2011-02-22 01:52:06 +00:00
Anders Carlsson
4fc229ef69
Move some Objective-C tests to SemaObjC and CodeGenObjC.
...
llvm-svn: 126175
2011-02-22 01:23:29 +00:00
Richard Smith
23eb9f707b
In Objective-C, there are no trailing return types, so don't produce diagnostics suggesting they are missing.
...
llvm-svn: 126174
2011-02-22 01:22:29 +00:00
Fariborz Jahanian
d7b0cb5388
Warn when type modifiers on objc method declarations in
...
protocols do not match with method implementation.
// rdar://7076235
llvm-svn: 126162
2011-02-21 23:49:15 +00:00
Fariborz Jahanian
786e04cda5
Turn on 'auto' in plain objc mode.
...
llvm-svn: 126134
2011-02-21 18:37:13 +00:00
Fariborz Jahanian
f5bfc46c95
Remove warning on future change in ivar lookup rule
...
when doing the property default synthesis.
// rdar://9027673.
llvm-svn: 126128
2011-02-21 17:31:28 +00:00
Anders Carlsson
ce8dd3a5d4
Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).
...
llvm-svn: 126061
2011-02-19 23:53:54 +00:00
Fariborz Jahanian
0dcb2a0d99
Test case for // rdar://8850818
...
llvm-svn: 125982
2011-02-18 22:37:54 +00:00
Douglas Gregor
af2a6ae429
Selector::getIdentifierInfoForSlot() can return NULL values, a fact
...
that was ignored in a few places (most notably, code
completion). Introduce Selector::getNameForSlot() for the common case
where we only care about the name. Audit all uses of
getIdentifierInfoForSlot(), switching many over to getNameForSlot(),
fixing a few crashers.
Fixed <rdar://problem/8939352>, a code-completion crasher.
llvm-svn: 125977
2011-02-18 22:29:55 +00:00
Fariborz Jahanian
5fc74804a6
Improve diagnostics on missing property decl.
...
llvm-svn: 125752
2011-02-17 17:30:05 +00:00
Fariborz Jahanian
05d389f407
Improve diagnostics when property names an object type of
...
a forward class. // rdar://8851803
llvm-svn: 125699
2011-02-17 01:26:14 +00:00
Fariborz Jahanian
d33ab8c635
Warn if method for a deprecated method is implemented.
...
Warn if class for a deprecated class is implemented.
Warn if category for a deprecated class is implemented.
All under control of -Wdeprecated-implementations.
// rdar://8973810.
llvm-svn: 125545
2011-02-15 00:59:30 +00:00
Ted Kremenek
05e63e0e37
Put "incomplete implementation" warning under a flag.
...
llvm-svn: 125535
2011-02-14 23:59:16 +00:00
Fariborz Jahanian
178259710a
Fix a block sema bug where result type of initializer
...
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379
llvm-svn: 125386
2011-02-11 18:46:17 +00:00
Fariborz Jahanian
ca3566fc20
Fix scoping of method declarations and issue
...
warning when same parameter name used multiple times.
// rdar://8877730
llvm-svn: 125229
2011-02-09 22:20:01 +00:00
Fariborz Jahanian
87967425f9
Support for objextive-c++ use of property-dot syntax as receiver
...
in liu of a class method getter.
// rdar://8962253
llvm-svn: 125094
2011-02-08 18:05:59 +00:00
Fariborz Jahanian
14889fc671
Support for objc use of property-dot syntax as receiver
...
in liu of a class method getter. objc++ uses a different
code path and is more involved (TBD).
llvm-svn: 125061
2011-02-08 00:23:07 +00:00
Ted Kremenek
e6a12a97d4
Move uninitialized variable checking back under -Wuninitialized-experimental. It is clear from user feedback that this warning is not quite ready.
...
llvm-svn: 125007
2011-02-07 17:38:38 +00:00
Fariborz Jahanian
a533af7d98
Restore a test which I accientally overwrote in my last
...
patch.
llvm-svn: 124911
2011-02-04 23:30:23 +00:00
Fariborz Jahanian
c9b7c209bb
-Wselector should warn on implemented selectors only
...
when selector metadata is generated, which is triggered
by at least on class implementation. This is to match gcc's
behavior. // rdar://8851684.
llvm-svn: 124909
2011-02-04 23:19:27 +00:00
Ted Kremenek
d68ec818c3
Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything but a instance method to a warning.
...
llvm-svn: 124858
2011-02-04 06:54:16 +00:00
Ted Kremenek
b3dbe28e31
Based on user feedback, swap -Wuninitialized diagnostics to have the warning refer to the bad use, and the note to the variable declaration.
...
llvm-svn: 124758
2011-02-02 23:35:53 +00:00
Argyrios Kyrtzidis
b5b5a59f18
Improve the diagnostic for -Wcustom-atomic-properties. Suggestion by Fariborz!
...
llvm-svn: 124620
2011-01-31 23:20:03 +00:00
Argyrios Kyrtzidis
dd88dbf9d2
Add -Wcustom-atomic-properties which warns if an atomic-by-default property has custom getter or setter.
...
The rationale is that it is highly likely that the user's getter/setter isn't atomically implemented. Off by default.
Addresses rdar://8782645.
-Wcustom-atomic-properties and -Wimplicit-atomic-properties are under the -Watomic-properties group.
llvm-svn: 124609
2011-01-31 21:34:11 +00:00
Ted Kremenek
4058d87ad5
Teach -Wuninitialized about ObjC fast enumeration loops.
...
llvm-svn: 124347
2011-01-27 02:01:31 +00:00
Fariborz Jahanian
9312fcc2d3
Tweak the rule for deciding if a provisional ivar is needed
...
in default ivar synthesis. Fixes // rdar://8913053.
llvm-svn: 124258
2011-01-26 00:57:01 +00:00
John McCall
4bb483629f
Change the wording of the bad-decl-for-attribute warning and error
...
to make it clear that we're talking about the declarations and not the types.
llvm-svn: 124175
2011-01-25 03:51:08 +00:00
Ted Kremenek
499897b463
Tweak diagnostic:
...
error: no super class declared in @interface for 'XXX'
to be:
error: 'X' cannot use 'super' because it is a root class
The latter explains what the user actually did wrong.
Fixes: <rdar://problem/8904409>
llvm-svn: 124074
2011-01-23 17:21:34 +00:00
Ted Kremenek
18f4a755a3
Add test case for <rdar://problem/8891119>. In
...
earlier revisions Clang was incorrectly warning
about an incomplete @implementation when a property
was getting synthesized. This got fixed somewhere
down the line.
llvm-svn: 123939
2011-01-20 19:45:14 +00:00
Fariborz Jahanian
a61f676cfe
Don't warn on missing 'copy' attribute on a 'block'
...
property when it is 'readonly'. // rdar://8820813
llvm-svn: 122923
2011-01-05 23:00:04 +00:00
Fariborz Jahanian
3aa19e9a70
Fold -fobjc-nonfragile-abi2 into -fobjc-nonfragile-abi.
...
// rdar://8818375
llvm-svn: 122831
2011-01-04 20:05:20 +00:00
Fariborz Jahanian
c63f1c5ab6
Guard lazy synthesis of provisional ivars under the new
...
-fobjc-default-synthesize-properties flag.
llvm-svn: 122757
2011-01-03 18:08:02 +00:00
Ted Kremenek
1d56c9eed7
Add -fobjc-default-synthesized-properties flag
...
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.
llvm-svn: 122519
2010-12-23 21:35:43 +00:00