summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Turned on support for __declspec(deprecated) in MS compatibility mode.Aaron Ballman2012-02-231-1/+2
| | | | llvm-svn: 151225
* Doug's review comments.Sebastian Redl2012-02-221-1/+1
| | | | llvm-svn: 151173
* Teach overload resolution to prefer user-defined conversion via aDouglas Gregor2012-02-221-0/+48
| | | | | | | | | | lambda closure type's function pointer conversion over user-defined conversion via a lambda closure type's block pointer conversion, always. This is a preference for more-standard code (since blocks are an extension) and a nod to efficiency, since function pointers don't require any memory management. Fixes PR12063. llvm-svn: 151170
* Fix parsing and processing initializer lists in return statements and as ↵Sebastian Redl2012-02-222-7/+33
| | | | | | direct member initializers. llvm-svn: 151155
* Warn about non-standard format strings (pr12017)Hans Wennborg2012-02-221-2/+60
| | | | | | | | | This adds the -Wformat-non-standard flag (off by default, enabled by -pedantic), which warns about non-standard things in format strings (such as the 'q' length modifier, the 'S' conversion specifier, etc.) llvm-svn: 151154
* More ArrayRef-ification of methods.Bill Wendling2012-02-221-1/+1
| | | | llvm-svn: 151152
* ArrayRef-icize the function arguments.Bill Wendling2012-02-223-5/+4
| | | | llvm-svn: 151151
* Throw away stray CXXDefaultArgExprs. Fixes PR12061.Sebastian Redl2012-02-221-0/+7
| | | | | | I think there's a deeper problem here in the way TransformCXXConstructExpr works, but I won't tackle it now. llvm-svn: 151146
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-223-14/+85
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Implement C++11 [expr.call]p11: If the operand to a decltype-specifier is aRichard Smith2012-02-225-12/+125
| | | | | | | | | | | | | | | | | | function call (or a comma expression with a function call on its right-hand side), possibly parenthesized, then the return type is not required to be complete and a temporary is not bound. Other subexpressions inside a decltype expression do not get this treatment. This is implemented by deferring the relevant checks for all calls immediately within a decltype expression, then, when the expression is fully-parsed, checking the relevant constraints and stripping off any top-level temporary binding. Deferring the completion of the return type exposed a bug in overload resolution where completion of the argument types was not attempted, which is also fixed by this change. llvm-svn: 151117
* Don't crash on attempts to synthesize an invalid property.John McCall2012-02-211-0/+1
| | | | | | rdar://problem/10904479 llvm-svn: 151089
* Only pop the expression evaluation context corresponding to a lambdaDouglas Gregor2012-02-211-5/+1
| | | | | | | | | expression after we've finished the function body of the corresponding function call operator. Otherwise, ActOnFinishFunctionBody() will see the (unfinished) evaluation context of the lambda expression itself. Fixes PR12031. llvm-svn: 151082
* When calling a non variadic format function(vprintf, vscanf, NSLogv, …), ↵Jean-Daniel Dupas2012-02-211-7/+21
| | | | | | warn if the format string argument is a parameter that is not itself declared as a format string with compatible format. llvm-svn: 151080
* Improve our handling of lambda expressions that occur within defaultDouglas Gregor2012-02-212-7/+34
| | | | | | | | | | | | | | | | | | | arguments. There are two aspects to this: - Make sure that when marking the declarations referenced in a default argument, we don't try to mark local variables, both because it's a waste of time and because the semantics are wrong: we're not in a place where we could capture these variables again even if it did make sense. - When a lambda expression occurs in a default argument of a function template, make sure that the corresponding closure type is considered dependent, so that it will get properly instantiated. The second bit is a bit of a hack; to fix it properly, we may have to rearchitect our handling of default arguments, parsing them only after creating the function definition. However, I'd like to separate that work from the lambdas work. llvm-svn: 151076
* Remove comma from end of enum to silence build warning.Craig Topper2012-02-211-1/+1
| | | | llvm-svn: 151036
* Implement non-internal linkage for lambda closure types that need aDouglas Gregor2012-02-211-5/+34
| | | | | | | | | stable mangling, since these lambdas can end up in multiple translation units. Sema is responsible for deciding when this is the case, because it's already responsible for choosing the mangling number. llvm-svn: 151029
OpenPOWER on IntegriCloud