summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* In debugger support mode, if we have a top-level message sendDouglas Gregor2011-12-151-0/+9
| | | | | | | expression with an unknown result type, assume that the result type is 'id'. Fixes <rdar://problem/10400663>. llvm-svn: 146622
* Fix/test decltype dtor calls with invalid base expression.David Blaikie2011-12-121-1/+1
| | | | llvm-svn: 146354
* Decltype in non-pseudo (& non-dependent) dtor calls.David Blaikie2011-12-081-0/+16
| | | | llvm-svn: 146155
* Implement support for the __is_final type trait, to determine whetherDouglas Gregor2011-12-031-0/+7
| | | | | | | a class is marked 'final', from Alberto Ganesh Barbati! Fixes PR11462. llvm-svn: 145775
* Revert r145244. It causes us to create broken ASTs with missing type informationRichard Smith2011-11-291-68/+64
| | | | | | | | | | for some cast expressions. Original commit message: Removed useless ImplicitCast nodes in explicit cstyle and static casts llvm-svn: 145447
* Removed useless ImplicitCast nodes in explicit cstyle and static castsNicola Gigante2011-11-281-64/+68
| | | | llvm-svn: 145244
* In Sema::MaybeBindToTemporary, create a CXXBindTemporaryExpr for anPeter Collingbourne2011-11-271-1/+2
| | | | | | array of objects with non-trivial destructors. PR11365. llvm-svn: 145203
* Added missing ImplicitCastExpr around conversion operator call.Abramo Bagnara2011-11-161-1/+7
| | | | llvm-svn: 144850
* Fixed missing cast and wrong cast kind in delete expression.Abramo Bagnara2011-11-161-2/+5
| | | | llvm-svn: 144796
* In ARC, don't reclaim objects of Class type.John McCall2011-11-141-0/+4
| | | | llvm-svn: 144561
* There's no good reason to track temporaries in ExprWithCleanups,John McCall2011-11-101-18/+18
| | | | | | | but it is sometimes useful to track blocks. Do so. Also optimize the storage of these expressions. llvm-svn: 144263
* Rip out CK_GetObjCProperty.John McCall2011-11-071-5/+0
| | | | llvm-svn: 143910
* Enable function call and some overload resolution with parameters of ↵Sebastian Redl2011-11-011-0/+1
| | | | | | aggregate class type and initializer list arguments. llvm-svn: 143462
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-17/+11
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-11/+17
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-17/+11
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Check for unexpanded parameter packs in the name that guards aDouglas Gregor2011-10-251-3/+17
| | | | | | | | | Microsoft __if_exists/__if_not_exists statement. Also note that we weren't traversing DeclarationNameInfo *at all* within the RecursiveASTVisitor, which would be rather fatal for variadic templates. llvm-svn: 142906
* Implement support for dependent Microsoft __if_exists/__if_not_existsDouglas Gregor2011-10-251-7/+15
| | | | | | | | | | statements. As noted in the documentation for the AST node, the semantics of __if_exists/__if_not_exists are somewhat different from the way Visual C++ implements them, because our parsed-template representation can't accommodate VC++ semantics without serious contortions. Hopefully this implementation is "good enough". llvm-svn: 142901
* Rework Microsoft __if_exists/__if_not_exists parsing and semanticDouglas Gregor2011-10-241-5/+25
| | | | | | | | | | | | | | | | | analysis to separate dependent names from non-dependent names. For dependent names, we'll behave differently from Visual C++: - For __if_exists/__if_not_exists at class scope, we'll just warn and then ignore them. - For __if_exists/__if_not_exists in statements, we'll treat the inner statement as a compound statement, which we only instantiate in templates where the dependent name (after instantiation) exists. This behavior is different from VC++, but it's as close as we can get without encroaching ridiculousness. The latter part (dependent statements) is not yet implemented. llvm-svn: 142864
* -Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.Richard Smith2011-10-181-11/+12
| | | | llvm-svn: 142419
* Make it possible to compute the type of 'this' without capturingDouglas Gregor2011-10-181-6/+8
| | | | | | it. Refactoring to be used in a moment. llvm-svn: 142360
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-0/+6
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Teach __has_nothrow_assign not to complain about access (GCC and EDGDouglas Gregor2011-10-121-1/+5
| | | | | | | ignore access entirely for it) and not to crash on assignment operator templates. Fixes PR11110. llvm-svn: 141777
* Catch placeholder types in DefaultLvalueConversionJohn McCall2011-10-111-0/+6
| | | | | | | | | | | and DefaultFunctionArrayLvalueConversion. To prevent significant regression for should-this-be-a-call fixits, and to repair some such regression from the introduction of bound member placeholders, make those placeholder checks try to build calls appropriately. Harden the build-a-call logic while we're at it. llvm-svn: 141738
* When performing a user-defined conversion via a constructor, be sureDouglas Gregor2011-10-101-6/+10
| | | | | | | to check whether the constructor is accessible. Fixes <rdar://problem/10202900>. llvm-svn: 141588
* Added a flag to identify resolved overloaded function references.Abramo Bagnara2011-10-051-4/+17
| | | | llvm-svn: 141171
* Refactor the analysis of C++ cast expressions so that evenJohn McCall2011-10-051-19/+2
| | | | | | | | C-style and functional casts are built in SemaCXXCast.cpp. Introduce a helper class to encapsulate most of the random state being passed around, at least one level down. llvm-svn: 141170
* Get rid of useless helper Sema::CastCategory.Eli Friedman2011-09-271-6/+5
| | | | llvm-svn: 140642
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-6/+0
| | | | llvm-svn: 140407
* Add a new warning to -Wliteral-conversion to catch cases where a string literalRichard Trieu2011-09-231-1/+1
| | | | | | | | | | | | | | is cast to a boolean. An exception has been made for string literals in logical expressions to allow the common case of use in assert statements. bool x; x = "hi"; // Warn here void foo(bool x); foo("hi"); // Warn here assert(0 && "error"); assert("error); // Warn here llvm-svn: 140405
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-7/+7
| | | | llvm-svn: 140367
* ArrayRef-ifying Function/BlockDecl's setParamsDavid Blaikie2011-09-211-1/+1
| | | | llvm-svn: 140268
* Enforce access control for conversion operators used in contextualJohn McCall2011-09-211-1/+3
| | | | | | conversions (rather than just call-arguments). llvm-svn: 140244
* Finish the lex->LHS and rex->RHS cleanup in Sema.Richard Trieu2011-09-151-27/+28
| | | | llvm-svn: 139856
* Rename the ARC cast kinds to start with "ARC".John McCall2011-09-101-2/+2
| | | | llvm-svn: 139466
* When converting a block pointer to an Objective-C pointer type, extendJohn McCall2011-09-101-0/+9
| | | | | | | | | | | the lifetime of the block by copying it to the heap, or else we'll get a dangling reference because the code working with the non-block-typed object will not know it needs to copy. There is some danger here, e.g. with assigning a block literal to an unsafe variable, but, well, it's an unsafe variable. llvm-svn: 139451
* Code formatting; no functionality change.John McCall2011-09-091-9/+9
| | | | llvm-svn: 139355
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* Perform array bounds checking in more situations and properly handle specialKaelyn Uhrain2011-08-051-3/+0
| | | | | | | | | | | | | | | | case situations with the unary operators & and *. Also extend the array bounds checking to work with pointer arithmetic; the pointer arithemtic checking can be turned on using -Warray-bounds-pointer-arithmetic. The changes to where CheckArrayAccess gets called is based on some trial & error and a bunch of digging through source code and gdb backtraces in order to have the check performed under as many situations as possible (such as for variable initializers, arguments to function calls, and within conditional in addition to the simpler cases of the operands to binary and unary operator) while not being called--and triggering warnings--more than once for a given ArraySubscriptExpr. llvm-svn: 136997
* In ARC, don't try to reclaim the result of a call to performSelectorJohn McCall2011-08-031-5/+8
| | | | | | unless done in a context where the value is used retained. llvm-svn: 136769
* Add */& mismatch fixit generation to the Sema::DiagnoseAssignmentResult().Anna Zaks2011-07-281-2/+2
| | | | llvm-svn: 136379
* Add support for C++0x unicode string and character literals, from Craig Topper!Douglas Gregor2011-07-271-6/+14
| | | | llvm-svn: 136210
* Re-fix r136172 so it isn't an error; apparently, some people are fond of ↵Eli Friedman2011-07-261-16/+13
| | | | | | their undefined behavior. llvm-svn: 136183
* Diagnose trying to delete a pointer to an abstract class with a non-virtual ↵Eli Friedman2011-07-261-1/+13
| | | | | | | | destructor. PR10504. I'm not completely sure the standard allows us to reject this, but if it doesn't, it should. :) llvm-svn: 136172
* A couple minor issues with Sema for delete:Eli Friedman2011-07-261-22/+28
| | | | | | | | | 1. Attempting to delete an expression of incomplete class type should be an error, not a warning. 2. If someone tries to delete a pointer to an incomplete class type, make sure we actually emit the delete expression after we warn. llvm-svn: 136161
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-10/+10
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Enforce access control for the destructor in a new[] expression and markJohn McCall2011-07-131-1/+11
| | | | | | | it as used. Otherwise, we can fail to instantiate or validate the destructor, which can lead to crashes in IR gen like PR10351. llvm-svn: 135073
* objc++-arc: more diagnosis of converting a weak-unavailableFariborz Jahanian2011-07-081-2/+14
| | | | | | object to a __weak object type. // rdar://9732636 llvm-svn: 134706
* In ARC, reclaim all return values of retainable type, not just thoseJohn McCall2011-07-071-7/+6
| | | | | | | | | | | | where we have an immediate need of a retained value. As an exception, don't do this when the call is made as the immediate operand of a __bridge retain. This is more in the way of a workaround than an actual guarantee, so it's acceptable to be brittle here. rdar://problem/9504800 llvm-svn: 134605
* Properly implement the scope restriction on the NRVO forDouglas Gregor2011-07-061-10/+64
| | | | | | | | | | | | throw-expressions, such that we don't consider the NRVO when the non-volatile automatic object comes from outside the innermost try scope (C++0x [class.copymove]p13). In C++98/03, our ASTs were incorrect but it didn't matter because IR generation doesn't actually apply the NRVO here. In C++0x, however, we were moving from an object when in fact we should have copied from it. Fixes PR10142 / <rdar://problem/9714312>. llvm-svn: 134548
OpenPOWER on IntegriCloud