summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an assertion, fix a whole bunch of bugs, comment the assertionJohn McCall2010-11-181-123/+210
| | | | | | out because there are still bugs left. llvm-svn: 119722
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-62/+156
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* comparison of AltiVec vectors now gives bool result (fix for 7533)Anton Yartsev2010-11-181-0/+5
| | | | llvm-svn: 119678
* Warn if direct accessing synthesized ivar backing the property inFariborz Jahanian2010-11-171-1/+7
| | | | | | nonofragile-abi2. Fixes //rdar://8673791 llvm-svn: 119543
* Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".Argyrios Kyrtzidis2010-11-171-6/+19
| | | | llvm-svn: 119540
* Don't emit warn_logical_and_in_logical_or for macros. Fixes rdar://8678458Argyrios Kyrtzidis2010-11-171-1/+1
| | | | llvm-svn: 119537
* Don't warn for parentheses for the '&&' inside '||' for cases like:Argyrios Kyrtzidis2010-11-171-11/+52
| | | | | | | | | | | | assert(a || b && "bad"); since this is safe. This way we avoid a big source of such warnings which in this case are practically useless. Note that we don't handle *all* cases where precedence wouldn't matter because of constants since this is a bit costly to check, and IMO clarifying precedence with parentheses is good for readability in general. llvm-svn: 119533
* Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922Argyrios Kyrtzidis2010-11-161-3/+23
| | | | llvm-svn: 119381
* Implements __block API for c++ objects. There is stillFariborz Jahanian2010-11-161-10/+14
| | | | | | | issue with runtime which I am discussing it with Blaine. This is wip (so no test yet). llvm-svn: 119368
* Kill off the remaining places which generate CK_Unknown casts.John McCall2010-11-161-8/+31
| | | | llvm-svn: 119326
* Yes, vector conversions are bitcasts.John McCall2010-11-151-3/+3
| | | | llvm-svn: 119141
* Assorted work leading towards the elimination of CK_Unknown.John McCall2010-11-151-108/+159
| | | | llvm-svn: 119138
* Add a few more complex-related cast kinds that arise due to arbitraryJohn McCall2010-11-141-30/+128
| | | | | | | | | | implicit conversions; the last batch was specific to promotions. I think this is the full set we need. I do think dividing the cast kinds into floating and integral is probably a good idea. Annotate a *lot* more C casts with useful cast kinds. llvm-svn: 119036
* Introduce five new cast kinds for various conversions into andJohn McCall2010-11-131-26/+42
| | | | | | between complex types. llvm-svn: 118994
* Bring UsualArithmeticConversionsType back into Sema and cast theJohn McCall2010-11-131-10/+244
| | | | | | | operands appropriately. There are a lot of missing complex-related cast kinds. llvm-svn: 118993
* Introduce a null-to-pointer implicit cast kind.John McCall2010-11-131-12/+19
| | | | llvm-svn: 118966
* Adding couple of Block API, a bug fix andFariborz Jahanian2010-11-111-6/+8
| | | | | | a test change, all for blocks. wip. llvm-svn: 118745
* Attempt to resolve overloaded functions in comma expressions andDouglas Gregor2010-11-091-0/+24
| | | | | | conditional operators. Fixes PR7863. llvm-svn: 118631
* Revert the fix for PR8013.Douglas Gregor2010-11-091-4/+6
| | | | | | | | | | | | | That bug concerned the well-formedness of code such as (&ovl)(a, b, c). GCC rejects the code, while EDG accepts it. On further study of the standard, I see no support for EDG's position: in particular, C++ [over.over] does not list this as a context where we can take the address of an overloaded function, C++ [over.call.func] does not reference the address-of operator at any point, and C++ [expr.call] claims that the function argument in a call is either a function lvalue or a pointer-to-function; (&ovl) is neither. llvm-svn: 118620
* Handle overload resolution when calling an overloaded function setDouglas Gregor2010-11-091-6/+4
| | | | | | with, e.g., (&f)(a, b, c). Fixes PR8013. llvm-svn: 118508
* When building a compound literal, check that the base element of the array ↵Argyrios Kyrtzidis2010-11-081-0/+5
| | | | | | | | is complete. Fixes rdar://8620582 & http://llvm.org/PR7905 llvm-svn: 118428
* Remove broken support for variadic templates, along with the variousDouglas Gregor2010-11-071-2/+1
| | | | | | | | | | | | | abstractions (e.g., TemplateArgumentListBuilder) that were designed to support variadic templates. Only a few remnants of variadic templates remain, in the parser (parsing template type parameter packs), AST (template type parameter pack bits and TemplateArgument::Pack), and Sema; these are expected to be used in a future implementation of variadic templates. But don't get too excited about that happening now. llvm-svn: 118385
* Expressions of type std::nullptr_t can be used as sentinels.Anders Carlsson2010-11-051-0/+4
| | | | llvm-svn: 118276
* It's OK to use nullptr in relational operators if the other side is a null ↵Anders Carlsson2010-11-041-6/+7
| | | | | | pointer constant. llvm-svn: 118234
* Improve source-location information for CXXConstructExpr nodes, byDouglas Gregor2010-11-031-1/+3
| | | | | | | | | ensuring that they cover all of their child nodes. There's still a clang_getCursor()-related issue with CXXFunctionalCastExprs with CXXConstructExprs as children (see FIXME in the test case); I'll look at that separately. llvm-svn: 118132
* Teach code completion to provide property results when the propertyDouglas Gregor2010-11-021-8/+23
| | | | | | can be used to automatically synthesize an ivar. llvm-svn: 118052
* Emit error when using a bound member function for something other than ↵Argyrios Kyrtzidis2010-11-011-0/+4
| | | | | | | | calling it. Also avoids IRGen crashes due to accepting invalid code. llvm-svn: 117943
* Require that the types of the parameters of a block literal are complete.Douglas Gregor2010-11-011-4/+6
| | | | llvm-svn: 117942
* Decay array/function types of a statement-expression.Fariborz Jahanian2010-10-271-2/+1
| | | | | | // rdar: // 8600553. llvm-svn: 117484
* patch to do array-to-pointer conversion in aFariborz Jahanian2010-10-271-0/+2
| | | | | | statement-expression. // rdar: //8600553 llvm-svn: 117479
* Delay complete-type checking for arguments to no-prototype functionsDouglas Gregor2010-10-261-12/+6
| | | | | | | | until after we've checked/promoted the argument. Hopefully fixes the Emacs regression due to my recent change that expanded type-checking in the presence of K&R function definitions. llvm-svn: 117353
* Patch for mis-compile of statement expressions withFariborz Jahanian2010-10-251-6/+28
| | | | | | | non-trivial copy constructors. // rdar: //8540501. A test will be added to llvm nightly tests. llvm-svn: 117324
* Look through the address-of operator to find the function beingDouglas Gregor2010-10-251-0/+4
| | | | | | called. Fixes another aspect of PR8314. llvm-svn: 117308
* When we're calling a function that we know based on its K&R-styleDouglas Gregor2010-10-251-10/+37
| | | | | | | | function definition, we should still use a prototype to type-check and convert the function arguments, if such a prototype exists. Fixes PR8314. llvm-svn: 117305
* Warn if a variable marked with the "unused" attribute is used. Patch by ↵Anders Carlsson2010-10-221-1/+5
| | | | | | Darin Adler! llvm-svn: 117184
* Fix handling of property and ivar lookup in typo correction; the twoDouglas Gregor2010-10-201-1/+3
| | | | | | | kinds of lookup into Objective-C classes were tangled together, a situation that was compounded by automatically synthesized ivars. llvm-svn: 116907
* Fixes a bug in ivar lookup in the new objc's defaultFariborz Jahanian2010-10-191-1/+6
| | | | | | | property synthesis mode, when dealing with legacy code. Fixes //rdar: //8565343. llvm-svn: 116846
* When marking declarations referenced within an expression (e.g.,Douglas Gregor2010-10-191-0/+4
| | | | | | | | within a default argument), recurse into default arguments. Fixes PR8401, a regression I introduced in r113700 while refactoring our handling of "used" declarations in default arguments. llvm-svn: 116817
* Report the location of the syntax error inside a macro. Fixes PR7944.Nick Lewycky2010-10-151-1/+1
| | | | llvm-svn: 116624
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-3/+8
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Introduce support for emitting diagnostics (warnings + their notes)Douglas Gregor2010-10-121-0/+18
| | | | | | | | | | | | | | | that are suppressed during template argument deduction. This change queues diagnostics computed during template argument deduction. Then, if the resulting function template specialization or partial specialization is chosen by overload resolution or partial ordering (respectively), we will emit the queued diagnostics at that point. This addresses most of PR6784. However, the check for unnamed/local template arguments (which existed before this change) is still only skin-deep, and needs to be extended to look deeper into types. It must be improved to finish PR6784. llvm-svn: 116373
* Fix anon union member assignment expression's location.Devang Patel2010-10-121-1/+1
| | | | | | This is tested by anon-union.exp in gdb testsuite. llvm-svn: 116371
* C's comma operator performs lvalue conversion on both its operands;John McCall2010-10-121-6/+11
| | | | | | require them to have complete types. llvm-svn: 116297
* I just do what the comments tell me to do.John McCall2010-10-121-1/+2
| | | | llvm-svn: 116289
* Progress.John McCall2010-10-121-32/+65
| | | | llvm-svn: 116287
* Add some infrastructure for dealing with expressions of 'placeholder' type,John McCall2010-10-121-12/+42
| | | | | | | i.e. expressions with an internally-convenient type which should not be appearing in generally valid, complete ASTs. llvm-svn: 116281
* This patch does a few things in the area of objective-cFariborz Jahanian2010-10-111-25/+32
| | | | | | | | | | | properties. 1. Generates the AST for lexical info. of accessing getter/setter methods using dot-syntax notation. This fixes //rdar: //8528170. 2. Modifes rewriter to handle the AST putout in 1. 3. Supportes in rewriter ObjCImplicitSetterGetter ASTs. llvm-svn: 116237
* Don't rely on a StringRef being null-terminated (it's not) for deprecation ↵Benjamin Kramer2010-10-091-6/+3
| | | | | | | | messages. Store pointer and length of the message in DelayedDiagnostic and hide the gory union details. llvm-svn: 116153
* Implement C++0x scoped enumerations, from Daniel Wallin! (and tweaked aDouglas Gregor2010-10-081-1/+15
| | | | | | bit by me). llvm-svn: 116122
* Fixed cast to union with anonymous bitfields.Abramo Bagnara2010-10-071-1/+2
| | | | llvm-svn: 115979
OpenPOWER on IntegriCloud