summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Tentatively fix PR12117. The test case from the bug now passes, and all ↵Sebastian Redl2012-02-291-8/+11
| | | | | | existing tests still pass, but there may still be corner cases. llvm-svn: 151716
* Reapply r151638 and r151641.James Molloy2012-02-294-3/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation. These are now fixed, with regression tests added to catch them both (not Darwin-specific). Original log: ==================== Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. ==================== llvm-svn: 151712
* A couple minor bug-fixes for template instantiation for expressions which ↵Eli Friedman2012-02-292-12/+15
| | | | | | are sometimes potentially evaluated. llvm-svn: 151707
* Make the odr-use logic work correctly for constant-expressions. PR12006.Eli Friedman2012-02-292-0/+19
| | | | llvm-svn: 151699
* Sema/ObjC: Override search can generate a large search list, bump the base sizeDaniel Dunbar2012-02-291-3/+4
| | | | | | | | of the SmallPtrSet way up to avoid commonly reallocating the buffer size. - I didn't see a good argument against it, so I bumped the limit to cover the max size we see during parsing Cocoa.h. llvm-svn: 151698
* Make sure list-initialization of arrays works correctly in explicit type ↵Eli Friedman2012-02-291-14/+18
| | | | | | conversions. PR12121. llvm-svn: 151674
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-284-82/+3
| | | | | | | | | | | | | | | | | | | | Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. llvm-svn: 151667
* Single- and zero-element initializer lists to scalars are ↵Sebastian Redl2012-02-281-0/+1
| | | | | | list-initializations. Fixes PR12118. llvm-svn: 151666
* Un-break clang based on r151638 - What was meant to be a trivial variable ↵James Molloy2012-02-281-1/+1
| | | | | | name change went horribly wrong and I forgot to retest afterwards. llvm-svn: 151641
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-284-3/+82
| | | | | | | | | | | | | | | function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. llvm-svn: 151638
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-281-5/+5
| | | | | | | | | | make sure to record the source location of the ivar name. [libclang] When indexing @synthesized objc methods, report the @implementation as the lexical container. Fixes rdar://10905472 llvm-svn: 151635
* [AST] Associate the getter/setter methods to a property of a objc class ↵Argyrios Kyrtzidis2012-02-281-4/+8
| | | | | | | | | | extension. [libclang] Index the getter/setter methods of a property of a objc class extension. Fixes rdar://10907597 llvm-svn: 151633
* After numerous requests, have Objective-C 'method declared here' notes ↵Ted Kremenek2012-02-272-8/+16
| | | | | | mention the actual method. This looks better within an IDE, where text isn't always regurgitated in the presentation of a warning. Fixes radar 10914035. llvm-svn: 151579
* Implement a FIXME for conversion sequence distinction. Should fix PR12092.Sebastian Redl2012-02-271-2/+10
| | | | llvm-svn: 151577
* Fix a couple bugs in the way we handle array indexes in array bounds ↵Eli Friedman2012-02-271-4/+4
| | | | | | checking. Specifically, make sure we don't ignore explicit casts in indexes, and make sure we use unsigned extension/comparisons on indexes. Fixes <rdar://problem/10916006>. llvm-svn: 151569
* Convert initializer lists to temporaries in CreateBuiltinBinOp. Allows ↵Sebastian Redl2012-02-271-0/+19
| | | | | | assignment of init lists to built-in types and resolves PR12088. llvm-svn: 151551
* Ensure that we delete default constructors in the right cases. Don't delete theRichard Smith2012-02-271-11/+9
| | | | | | | default constructor of a union if it has a const member with no user-provided default constructor. llvm-svn: 151516
* Don't assert when trying to diagnose why a class with a constructor template isRichard Smith2012-02-261-9/+25
| | | | | | non-trivial. llvm-svn: 151486
* Ensure that we delete destructors in the right cases. Specifically:Richard Smith2012-02-262-105/+96
| | | | | | | | | | | | | | - variant members with nontrivial destructors make the containing class's destructor deleted - check for a virtual destructor after checking for overridden methods in the base class(es) - check for an inaccessible operator delete for a class with a virtual destructor. Do not try to call an anonymous union field's destructor from the destructor of the containing class. llvm-svn: 151483
* Make sure we don't try to produce a definition of an implicitly-deleted functionRichard Smith2012-02-262-8/+15
| | | | llvm-svn: 151478
* Special members which are defaulted or deleted on their first declaration areRichard Smith2012-02-261-0/+53
| | | | | | | | | | | | | trivial if the implicit declaration would be. Don't forget to set the Trivial flag on the special member as well as on the class. It doesn't seem ideal that we have two separate mechanisms for storing this information, but this patch does not attempt to address that. This leaves us in an interesting position where the has_trivial_X trait for a class says 'yes' for a deleted but trivial X, but is_trivially_Xable says 'no'. This seems to be what the standard requires. llvm-svn: 151465
* ArrayRef'ize various functions in the AST/Parser/Sema.Ahmed Charles2012-02-258-186/+214
| | | | llvm-svn: 151447
* Accept __has_feature(__feature__) as a synonym for __has_feature(feature) (andRichard Smith2012-02-251-1/+2
| | | | | | likewise for __has_extension). Patch by Jonathan Sauer! llvm-svn: 151445
* Fix r151443 to only apply C++11's exception for non-static data member accessRichard Smith2012-02-251-5/+14
| | | | | | | in cases where we would otherwise disallow the access, and add a -Wc++98-compat diagnostic for this C++11 feature. llvm-svn: 151444
* PR11956: C++11's special exception for accessing non-static data members fromRichard Smith2012-02-251-15/+15
| | | | | | unevaluated operands applies within member functions, too. llvm-svn: 151443
* Fix assertion (too few Diag arguments) when diagnosing a deleted operator deleteRichard Smith2012-02-251-1/+2
| | | | llvm-svn: 151442
* Fix a regression from r151117: ADL requires that we attempt to complete anyRichard Smith2012-02-252-6/+13
| | | | | | | | associated classes, since it can find friend functions declared within them, but overload resolution does not otherwise require argument types to be complete. llvm-svn: 151434
* Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman2012-02-251-5/+11
| | | | | | implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
* Improve the diagnostic in ARC mode when a conditional with an Objective-C ↵Eli Friedman2012-02-251-0/+16
| | | | | | type and void* is used. <rdar://problem/10486347>. llvm-svn: 151416
* Bugfix: bogus warning -- "invalid use of non-static data member",DeLesley Hutchins2012-02-251-1/+2
| | | | | | | when a class is forward declared, and the reference to the data member in question does not occur within a method body. llvm-svn: 151413
* Implement C++11 [over.match.copy]p1b2, which allows the use ofDouglas Gregor2012-02-244-18/+52
| | | | | | | | | | | explicit conversion functions to initialize the argument to a copy/move constructor that itself is the subject of direct initialization. Since we don't have that much context in overload resolution, we end up threading more flags :(. Fixes <rdar://problem/10903741> / PR10456. llvm-svn: 151409
* Make helper static.Benjamin Kramer2012-02-241-1/+1
| | | | llvm-svn: 151400
* C++11 [class.ctor]p5 says thatDouglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | | | | | | A defaulted default constructor for a class X is defined as deleted if [...] - X is a union and all of its variant members are of const-qualified type. A pedantic reading therefore says that union X { }; has a deleted default constructor, which is both silly and almost certainly unintended. Pretend as if this this read - X is a union with one or more variant members, and all of its variant members are of const-qualified type. llvm-svn: 151394
* Fix comment: correct predicate name, reformat comment.Dmitri Gribenko2012-02-241-5/+4
| | | | llvm-svn: 151389
* __decltype is a GNU extension, not a C++11 extension.Richard Smith2012-02-241-2/+0
| | | | llvm-svn: 151377
* Two minor, related fixes for template instantiation with blocks:Douglas Gregor2012-02-241-2/+6
| | | | | | | | | | | | - Make sure that the block expression is instantiation-dependent if the block is in a dependent context - Make sure that the C++ 'this' expression gets captured even if we don't rebuild the AST node during template instantiation. This would also have manifested as a bug for lambdas. Fixes <rdar://problem/10832617>. llvm-svn: 151372
* Sink variable into assertMatt Beaumont-Gay2012-02-241-2/+1
| | | | llvm-svn: 151356
* Kill a spurious use of hasTrivialDefaultConstructor()Douglas Gregor2012-02-241-2/+1
| | | | llvm-svn: 151353
* Implement a new type trait __is_trivially_constructible(T, Args...)Douglas Gregor2012-02-242-0/+254
| | | | | | | | | | | | | | | | that provides the behavior of the C++11 library trait std::is_trivially_constructible<T, Args...>, which can't be implemented purely as a library. Since __is_trivially_constructible can have zero or more arguments, I needed to add Yet Another Type Trait Expression Class, this one handling arbitrary arguments. The next step will be to migrate UnaryTypeTrait and BinaryTypeTrait over to this new, more general TypeTrait class. Fixes the Clang side of <rdar://problem/10895483> / PR12038. llvm-svn: 151352
* Modernize some code which processes CastExprs to use CastKinds. No intended ↵Eli Friedman2012-02-231-29/+21
| | | | | | functional change. llvm-svn: 151298
* objective-c++: Type of an objc string literal is NSString, not 'id'.Fariborz Jahanian2012-02-231-3/+15
| | | | | | // rdar://10907410 llvm-svn: 151296
* Turned on support for __declspecs: noreturn, noinline, nothrow and naked in ↵Aaron Ballman2012-02-231-4/+13
| | | | | | MS compatibility mode. llvm-svn: 151295
* Pull the OpaqueValueExpr's source expression into its constructor, soDouglas Gregor2012-02-232-3/+4
| | | | | | that we can correctly compute value-dependence of the OVE. llvm-svn: 151291
* [libclang] Make sure that all top-level decls in a @implementation areArgyrios Kyrtzidis2012-02-231-0/+19
| | | | | | | | marked as such. Previously we missed tag declarations; fixes rdar://10902015 llvm-svn: 151283
* objective-c default synthesis. classes which adopt protocol propertiesFariborz Jahanian2012-02-231-1/+2
| | | | | | | must still auto synthesize those propeties which have been redeclared in the class. // rdar://10907410 llvm-svn: 151268
* Replace some DenseSets with SmallPtrSets. Apart from the "small" ↵Benjamin Kramer2012-02-232-6/+4
| | | | | | optimization, the current implementation is also a denser. llvm-svn: 151257
* Replace the std::map in the init list checker with a DenseMap to reduce ↵Benjamin Kramer2012-02-231-3/+3
| | | | | | malloc thrashing. llvm-svn: 151254
* Provide the __is_trivially_assignable type trait, which providesDouglas Gregor2012-02-231-0/+49
| | | | | | | compiler support for the std::is_trivially_assignable library type trait. llvm-svn: 151240
* Two fixes to how we compute visibility:Rafael Espindola2012-02-231-0/+1
| | | | | | | | | | | | * Handle some situations where we should never make a decl more visible, even when merging in an explicit visibility. * Handle attributes in members of classes that are explicitly specialized. Thanks Nico for the report and testing, Eric for the initial review, and dgregor for the awesome test27 :-) llvm-svn: 151236
* Try to handle qualifiers more consistently for array InitListExprs. Fixes ↵Eli Friedman2012-02-232-5/+8
| | | | | | | | <rdar://problem/10907510>, and makes the ASTs a bit more self-consistent. (I've chosen to keep the qualifiers, but it isn't a strong preference; if anyone prefers removing them, please yell.) llvm-svn: 151229
OpenPOWER on IntegriCloud