- Jun 11, 2011
-
-
Douglas Gregor authored
Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
-
Fariborz Jahanian authored
properties. llvm-svn: 132866
-
- Jun 10, 2011
-
-
Alexis Hunt authored
to study it. llvm-svn: 132843
-
Alexis Hunt authored
I believe, upon, careful review, that this code causes us to incorrectly handle exception specifications of copy assignment operators in C++03 mode. However, we currently do not seem to properly implement the subtle distinction between copying of members and bases made by implicit copy constructors and assignment operators in C++03 - namely that they are limited in their overload selection - in all cases. As such, I feel that committing this code is correct pending a careful review of our implementation of these semantics. llvm-svn: 132841
-
Alexis Hunt authored
llvm-svn: 132835
-
Alexis Hunt authored
isn't yet used for the less controlled environments of initialization. Also a few random text fixups. llvm-svn: 132833
-
Richard Trieu authored
- Removed fix-it hints from template instaniations since changes to the templates are rarely helpful. - Changed the caret in template instaniations from the class/struct name to the class/struct keyword, matching the other warnings. - Do not offer fix-it hints when multiple declarations disagree. Warnings are still given. - Once a definition is found, offer a fix-it hint to all previous declarations with wrong tag. - Declarations that disagree with a previous definition will get a fix-it hint to change the declaration. llvm-svn: 132831
-
- Jun 09, 2011
-
-
Hans Wennborg authored
This is a follow-up to r132565, and should address the rest of PR9969: Warn about cases such as int foo(A a, bool b) { return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2); } also when + is an overloaded operator call. llvm-svn: 132784
-
- Jun 08, 2011
-
-
Fariborz Jahanian authored
It is not a sanctioned keyword and is assumed as default. // rdar://8790791 llvm-svn: 132753
-
Peter Collingbourne authored
This fixes a memory error on FreeBSD (and is the right thing to do in any case). llvm-svn: 132750
-
Chandler Carruth authored
were intended for was suppressed. llvm-svn: 132746
-
Chandler Carruth authored
namespace set algorithm (re-)introduced. We may not have seen the 'std' namespace, but we should still suggested associated namespaces. Easy fix, but a bit annoying to test. llvm-svn: 132744
-
- Jun 07, 2011
-
-
Fariborz Jahanian authored
declared __weak objc-gc mode. // rdar://9666091. llvm-svn: 132731
-
Alexis Hunt authored
llvm-svn: 132700
-
- Jun 06, 2011
-
-
Douglas Gregor authored
specializing a member of an unspecialized template, and recover from such errors without crashing. Fixes PR10024 / <rdar://problem/9509761>. llvm-svn: 132677
-
Chandler Carruth authored
this. My suggestion assumed a viable erase method for iterators on SmallPtrSet. This patch restores his original pattern. llvm-svn: 132673
-
Richard Smith authored
Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept due to a lack of proper support for two-phase name lookup. llvm-svn: 132672
-
- Jun 05, 2011
-
-
Sebastian Redl authored
Drop most of InitializationSequence::SequenceKind's values. They didn't really contain any information that the step array didn't contain too. This makes debugging dumps a bit less informative, but probably not significantly so. The advantage is that the redundancy is gone, so the code is easier to understand. ReferenceBinding is still there, because it is used in some unclear code. llvm-svn: 132667
-
Sebastian Redl authored
llvm-svn: 132666
-
Sebastian Redl authored
Remove all references to InitializationSequence::FailedSequence from outside SemaInit.cpp. Replace them with the boolean conversion or the new Failed() function. This is a first step towards removing InitializationSequence::SequenceKind. No functionality change. llvm-svn: 132664
-
Douglas Gregor authored
compared even when one is a reference binding and the other is not (<rdar://problem/9173984>), but the definition of an identity sequence does not involve lvalue-to-rvalue adjustments (PR9507). Fix both inter-related issues. llvm-svn: 132660
-
Douglas Gregor authored
return <expression> ; in blocks with a 'void' result type, so long as <expression> has type 'void'. This follows the rules for C++ functions. llvm-svn: 132658
-
Douglas Gregor authored
with a type-dependent expression, infer the placeholder type 'Context.DependentTy' to indicate that this is just a placeholder. Fixes PR9982 / <rdar://problem/9486685>. llvm-svn: 132657
-
- Jun 04, 2011
-
-
Alexis Hunt authored
the self-host failures and Chandler's concerns. llvm-svn: 132622
-
Tanya Lattner authored
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
-
Douglas Gregor authored
libclang. Fixes <rdar://problem/9537904>. llvm-svn: 132603
-
- Jun 03, 2011
-
-
Alexis Hunt authored
suggested by Chandler. llvm-svn: 132593
-
Alexis Hunt authored
destructors are implemented but other special members are on the way, which is where the real benefits of this will be visible. llvm-svn: 132572
-
Hans Wennborg authored
Warn in cases such as "x + someCondition ? 42 : 0;", where the condition expression looks arithmetic, and has a right-hand side that looks boolean. This (partly) addresses http://llvm.org/bugs/show_bug.cgi?id=9969 llvm-svn: 132565
-
Hans Wennborg authored
In code such as "char* volatile const j()", Clang warns that "volatile const" will be ignored. Make it point to the first ignored qualifier, and simplify the code a bit. llvm-svn: 132563
-
Douglas Gregor authored
Sema::RequireCompleteExprType() a bit more, setting the point of instantiation if needed, and skipping explicit specializations entirely. llvm-svn: 132547
-
Francois Pichet authored
llvm-svn: 132546
-
Francois Pichet authored
llvm-svn: 132544
-
Francois Pichet authored
I'll try to implement this functionality again soon. llvm-svn: 132536
-
Chandler Carruth authored
diagnostic group to cover the cases where we have definitively bad behavior: dynamic classes. It also rips out the existing support for POD-based checking. This didn't work well, and triggered too many false positives. I'm looking into a possibly more principled way to warn on the fundamental buggy construct here. POD-ness isn't the critical aspect anyways, so a clean slate is better. This also removes some silliness from the code until the new checks arrive. llvm-svn: 132534
-
Douglas Gregor authored
of incomplete array type, attempt to complete the array type. This was made much easier by Chandler's addition of RequireCompleteExprType(), which I've tweaked (slightly) to improve the consistency of the DeclRefExpr. Fixes PR7985. llvm-svn: 132530
-
Douglas Gregor authored
the template parameter, perform the checking as a "specified" template argument rather than a "deduced" template argument; the latter implies stricter type checking that is not permitted for default template arguments. Also, cleanup our handling of substitution of explicit template arguments for a function template. We were actually performing some substitution of default arguments at this point! Fixes PR10069. llvm-svn: 132529
-
- Jun 02, 2011
-
-
Rafael Espindola authored
llvm-svn: 132460
-
Douglas Gregor authored
+keyPathsForValuesAffecting<Key> completion was mislabeled as an instance method, and +automaticallyNotifiesObserversOf<Key> was missing entirely. Fixes <rdar://problem/9516762>. llvm-svn: 132452
-
Francois Pichet authored
llvm-svn: 132447
-