summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* <rdar://problem/13473493> Handle 'this->' insertion recovery within trailing ↵Douglas Gregor2013-03-261-2/+3
| | | | | | return types. llvm-svn: 178081
* Fix DeclRefExpr::getFoundDecl() for usages by reference.Daniel Jasper2013-03-221-6/+6
| | | | llvm-svn: 177721
* Fix a crash-on-valid where a block capture copy expression wasJohn McCall2013-03-221-3/+5
| | | | | | | | | | | | picking up cleanups from earlier in the statement. Also fix a crash-on-invalid where a reference to an invalid decl from an enclosing scope was causing an expression to fail to build, but only *after* a cleanup was registered from that statement, causing an assertion downstream. The crash-on-valid is rdar://13459289. llvm-svn: 177692
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-191-0/+3
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Diagnose uses of 'alignof' on functions in -pedantic mode.Richard Smith2013-03-181-5/+6
| | | | llvm-svn: 177354
* Bring inheriting constructor implementation up-to-date with current defectRichard Smith2013-03-181-0/+3
| | | | | | | | | reports, and implement implicit definition of inheriting constructors. Remaining missing features: inheriting constructor templates, implicit exception specifications for inheriting constructors, inheriting constructors from dependent bases. llvm-svn: 177320
* Add some assertions to appease the static analyzer.Jordan Rose2013-03-151-0/+1
| | | | | | No functionality change. llvm-svn: 177185
* Avoid computing the linkage too early. Don't invalidate it.Rafael Espindola2013-03-141-1/+1
| | | | | | | | | | | | | | | | | | Before this patch we would compute the linkage lazily and cache it. When the AST was modified in ways that could change the value, we would invalidate the cache. That was fairly brittle, since any code could ask for the a linkage before the correct value was available. We should change the API to one where the linkage is computed explicitly and trying to get it when it is not available asserts. This patch is a first step in that direction. We still compute the linkage lazily, but instead of invalidating a cache, we assert that the AST modifications didn't change the result. llvm-svn: 176999
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-12/+13
| | | | | | No (intended) functionality change. llvm-svn: 176726
* objective-C: don't crash after diagnosingFariborz Jahanian2013-03-061-2/+2
| | | | | | | using object subscripting without declaring objectForKeyedSubscript: // rdar://13333205 llvm-svn: 176539
* Centralize and refine the __unknown_anytype argument rulesJohn McCall2013-03-041-17/+21
| | | | | | | | | and be sure to apply them whether or not the debugger gave us a method declaration. rdar://12565338 llvm-svn: 176432
* Perform non-overload placeholder conversions on the operandsJohn McCall2013-03-041-16/+39
| | | | | | | | to a subscript operator. rdar://13332183 llvm-svn: 176428
* Remove superfluous null pointer check. The pointer is used prior to this check.Ted Kremenek2013-02-211-7/+6
| | | | llvm-svn: 175807
* Teach serialized diagnostics about notes without locations.Ted Kremenek2013-02-211-2/+7
| | | | | | | | Along the way, improve a diagnostic for "previous declaration here" for implicit parameters. Fixes <rdar://problem/13211384>. llvm-svn: 175802
* Add support to Sema and CodeGen for floating point vector types in OpenCL.Joey Gouly2013-02-211-6/+45
| | | | llvm-svn: 175734
* Avoid implicit conversions of Optional<T> to bool.David Blaikie2013-02-211-3/+3
| | | | | | | This is a precursor to making Optional<T>'s operator bool 'explicit' when building Clang & LLVM as C++11. llvm-svn: 175722
* Replace TypeLoc llvm::cast support to be well-defined.David Blaikie2013-02-181-4/+3
| | | | | | | | | | | | | | The TypeLoc hierarchy used the llvm::cast machinery to perform undefined behavior by casting pointers/references to TypeLoc objects to derived types and then using the derived copy constructors (or even returning pointers to derived types that actually point to the original TypeLoc object). Some context is in this thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-December/056804.html Though it's spread over a few months which can be hard to read in the mail archive. llvm-svn: 175462
* Prevent crash on multiple user errors (which I cannot reproduce inFariborz Jahanian2013-02-181-0/+4
| | | | | | a small test case). // rdar://13178483. llvm-svn: 175450
* Sema: Unnest early exit and remove an unnecessary bad cast.Benjamin Kramer2013-02-151-13/+12
| | | | | | | cast<ObjCObjectPointerType> doesn't look through sugar, getAs does. Fixes PR15257. llvm-svn: 175272
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-141-1/+2
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* When marking derived classes' virtual methods ODR-used in order to triggerNick Lewycky2013-02-141-1/+1
| | | | | | | instantiation in order to permit devirtualization later in codegen, skip over pure functions since those can't be devirtualization targets. llvm-svn: 175116
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-121-1/+3
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Perform placeholder conversions on the controller of a _GenericJohn McCall2013-02-121-0/+6
| | | | | | expression. llvm-svn: 174930
* Diagnose loads of 'half' l-values in OpenCL.John McCall2013-02-121-15/+8
| | | | | | Patch by Joey Gouly! llvm-svn: 174928
* Test for virtual instead of pure here. It has the exact same effect, and JohnNick Lewycky2013-02-051-1/+1
| | | | | | claims it will improve performance. llvm-svn: 174341
* PR15095: Use more correct source locations for the InitListExpr we fake up forRichard Smith2013-02-051-3/+8
| | | | | | vector initialization. Patch by John Stratton! llvm-svn: 174339
* Add some missing diagnostics for C++11 narrowing conversions.Richard Smith2013-02-051-2/+3
| | | | llvm-svn: 174337
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-021-6/+7
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* This patch makes "&Cls::purevfn" not an odr use. This isn't what the standardNick Lewycky2013-02-021-15/+28
| | | | | | | | | says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use. Also fixes a bug that caused us to not mark the function referenced just because we didn't want to mark it odr used. llvm-svn: 174242
* objc: Provide correct fixit instruction when two mismatchedFariborz Jahanian2013-02-011-2/+3
| | | | | | nsstringis are compared without. // rdar://12716301 llvm-svn: 174214
* Fix PR14881 by implementing conversion rules between int and complex int.Bill Schmidt2013-02-011-54/+68
| | | | | | | | | | | | | | Prior to the patch, Clang does not properly promote types when a complex integer operand is combined with an integer via a binary operator, or when one is assigned to the other in either order. This patch detects when promotion is needed (and permissible) and generates the necessary code. The test assmes no target has the same size operands for "char" and "long long," and that no target performs arithmetic on char operands without extending them to a larger format first. If there are any targets for which this is not the case, they should be XFAILed. llvm-svn: 174181
* Add a new -Wundefined-inline warning for inline functions which are used but notNick Lewycky2013-02-011-4/+8
| | | | | | defined. Fixes PR14993! llvm-svn: 174158
* Fix grammar in comment.Nick Lewycky2013-01-311-1/+1
| | | | llvm-svn: 174033
* Fix ODR-use of a MemberExpr to check before marking a pure function used. RemoveNick Lewycky2013-01-311-2/+12
| | | | | | a workaround for this bug from the -Wundefined-internals warning. llvm-svn: 174020
* Hoist retrieval of Expr* into caller. No functionality change.Ted Kremenek2013-01-301-6/+6
| | | | | | Just makes the code a little cleaner, and easier to reason about. llvm-svn: 173953
* Also promote fp16 types to double when they're anonymous variadic arguments.Tim Northover2013-01-301-4/+8
| | | | | | | | __fp16 isn't covered by the standard, but this resolves the oddity that float gets promoted when passed variadically, but not the smaller type. This is required by the AArch64 ABI, and a sane action elsewhere. llvm-svn: 173918
* Micro cleanup: use an array of const char, rather than an array of char, as theRichard Smith2013-01-231-1/+1
| | | | | | | type of the string literal implicitly used for a raw user-defined literal call. No test; this has no semantic impact. llvm-svn: 173309
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-4/+17
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn onRichard Smith2013-01-171-1/+1
| | | | | | | expressions which have undefined behavior due to multiple unsequenced modifications or an unsequenced modification and use of a variable. llvm-svn: 172690
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-1/+1
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* put back diagnostics when flexible members are capturedFariborz Jahanian2013-01-091-1/+4
| | | | | | in lambdas. llvm-svn: 171921
* Fix typo (again).Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171917
* Remove lambda from my last patch.Fariborz Jahanian2013-01-081-4/+1
| | | | llvm-svn: 171915
* Fixes typo in comment.Fariborz Jahanian2013-01-081-1/+1
| | | | llvm-svn: 171913
* objectiveC blocks: It is impractical to capture Fariborz Jahanian2013-01-081-1/+16
| | | | | | | | struct variables with flexiable array members in blocks (and lambdas). Issue error instead of crashing in IRGen. // rdar://12655829 llvm-svn: 171912
* Move loop variable update.Rafael Espindola2013-01-081-2/+1
| | | | | | Thanks to Dmitri Gribenko for the suggestion. llvm-svn: 171889
* Mark all subsequent decls used.Rafael Espindola2013-01-081-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | In the source static void f(); static void f(); template<typename T> static void g() { f(); } static void f() { } void h() { g<int>(); } the call to f refers to the second decl, but it is only marked used at the end of the translation unit during instantiation, after the third f decl has been linked in. With this patch we mark all subsequent decls used, so that it is easy to check if a symbol is used or not. llvm-svn: 171888
* Don't warn about undefined varargs argument behavior in unreachable code.Ted Kremenek2013-01-081-5/+5
| | | | | | Fixes <rdar://problem/12322000>. llvm-svn: 171831
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-0/+5
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few ↵Richard Smith2013-01-021-1/+1
| | | | | | nearby 'C++0x' comments. llvm-svn: 171372
OpenPOWER on IntegriCloud