summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Patch to check at compile time for overflow whenFariborz Jahanian2014-09-181-2/+2
| | | | | | | | __builtin___memcpy_chk and similar builtins are being used. Patch by Jacques Fortier (with added clang tests). rdar://11076881 llvm-svn: 218063
* Don't try to devirtualize non-virtual callsReid Kleckner2014-09-161-0/+4
| | | | | | | | | | | We would end up marking the vtable of the derived class as used for no reason. Because the call itself is qualified, it is never virtual, and the vtable of the derived class isn't helpful. We would end up rejecting code that MSVC accepts for no benefit. See http://crbug.com/413478 llvm-svn: 217910
* Objective-C arc. Fixes a crash when issuing diagnostic forFariborz Jahanian2014-09-101-1/+1
| | | | | | passing parameter to an audited CF API. rdar://18222007 llvm-svn: 217530
* Split off CUDA-specific Sema parts to a new fileEli Bendersky2014-09-031-17/+0
| | | | | | | | | | | In line with SemaOpenMP.cpp, etc. CUDA-specific semantic analysis code goes into a separate file. This is in anticipation of adding extra functionality here in the near future. No change in functionality. Review: http://reviews.llvm.org/D5160 llvm-svn: 217043
* [C++11] Support for capturing of variable length arrays in lambda expression.Alexey Bataev2014-08-281-11/+30
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* Call ResolveExceptionSpec for non-OdrUsed functions.Nico Weber2014-08-271-6/+9
| | | | | | | | In C++11, instantiation of exception specs is deferred. The instantiation is done in MarkFunctionReferenced(), which wasn't called for non-OdrUsed functions, which then caused an assert in codegen. Fixes PR19190, see the bug for details. llvm-svn: 216562
* Fix a bad location in -Wparentheses fix-it hintRichard Trieu2014-08-231-1/+1
| | | | | | | The code used getLocStart() instead of getLocEnd(). This works for single token expressions, but breaks if the expression is longer. llvm-svn: 216306
* C++1y is now C++14!Aaron Ballman2014-08-191-2/+2
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Sema: Disallow taking the address of a bitfield coming from preincrementDavid Majnemer2014-07-311-2/+5
| | | | | | | | | | | | | | Clang forgot that '++s.m' was a bitfield l-value and permit it's address to be taken; this would crash at CodeGen-time. Instead, propagate the object-kind when we see the prefix increment/decrement. This fixes PR20496. Differential Revision: http://reviews.llvm.org/D4733 llvm-svn: 214386
* Not all instantiated variable is odr-used. Do not mark non-odr-used variable ↵Larisse Voufo2014-07-301-0/+6
| | | | | | template specializations as such. llvm-svn: 214267
* Fix typo.Larisse Voufo2014-07-291-1/+1
| | | | llvm-svn: 214193
* Fix PR10177 where non-type template arguments to alias templates are not ↵Larisse Voufo2014-07-291-19/+21
| | | | | | marked as used in dependent contexts. The fix actually forces non-dependent names to be checked at template definition time as expected from the standard. llvm-svn: 214192
* Wrap to 80 columns. No behavior change.Nico Weber2014-07-271-4/+3
| | | | llvm-svn: 214047
* Objective-C. Warn if protocol used in an @protocolFariborz Jahanian2014-07-251-0/+9
| | | | | | | expression is a forward declaration as this results in undefined behavior. rdar://17768630 llvm-svn: 213968
* Improving the "integer constant too large" diagnostics based on post-commit ↵Aaron Ballman2014-07-241-6/+5
| | | | | | feedback from Richard Smith. Amends r213657. llvm-svn: 213865
* Provide extra information in the "integer constant is too large" diagnostic. ↵Aaron Ballman2014-07-221-3/+6
| | | | | | This will be used to improve other diagnostics. llvm-svn: 213657
* PR20356: Fix all Sema warnings with mismatched ext_/warn_ versusRichard Smith2014-07-191-6/+6
| | | | | | | | ExtWarn/Warnings. Mostly the name of the warning was changed to match the semantics, but in the PR20356 cases, the warning was about valid code, so the diagnostic was changed from ExtWarn to Warning instead. llvm-svn: 213443
* Avoid referencing the vtable when calling the ctor without emitting itReid Kleckner2014-07-161-2/+0
| | | | | | | | | | | | | | This fixes compilation errors about incomplete types used with WebKit's RefPtr template. Simply calling an out of line constructor should not instantiate all inline and defaulted virtual methods. Tested by building and testing several big piles of code on Linux. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4429 llvm-svn: 213109
* Form a CallExpr from __noop without parensReid Kleckner2014-07-111-1/+14
| | | | | | | | | | | | MSVC accepts __noop without any trailing parens and treats it like a literal zero. We don't treat __noop as an integer literal, but now at least we can parse a naked __noop expression. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4476 llvm-svn: 212860
* Fix typos.Nikola Smiljanic2014-07-091-1/+1
| | | | llvm-svn: 212589
* Switch over a few uses of param_begin() to parameters()Alp Toker2014-07-071-1/+1
| | | | llvm-svn: 212442
* Using of variable length arrays in captured statements and OpenMP constructs.Alexey Bataev2014-06-301-3/+102
| | | | | | Differential Revision: http://reviews.llvm.org/D4067 llvm-svn: 212010
* Objective-C ARC. Provide diagnostic and fix-it Fariborz Jahanian2014-06-261-1/+3
| | | | | | | | | when casting a retainable object to a objc_bridge_related CF type with the suggestion of applying the method specified in the bridging attribute to the object. // rdar://15932435 llvm-svn: 211807
* Convert StringLiteralParser constructor to use ArrayRef instead of a pointer ↵Craig Topper2014-06-261-5/+4
| | | | | | and count. llvm-svn: 211763
* Propagate isAddressOfMember into typo correction so that we don't correct ↵Nick Lewycky2014-06-231-0/+14
| | | | | | &qualified-id into &unqualified-id. Also make sure to set the naming class when we find the qualified-id in a different class than the nested name specifier specified so far. Fixes PR19681! llvm-svn: 211551
* Lex: Use the correct types for MS integer suffixesDavid Majnemer2014-06-211-13/+17
| | | | | | | | | | | | | | | | Something went wrong with r211426, it is an older version of this code and should not have been committed. It was reverted with r211434. Original commit message: We didn't properly implement support for the sized integer suffixes. Suffixes like i16 were essentially ignored instead of mapping them to the appropriately sized integer type. This fixes PR20008. Differential Revision: http://reviews.llvm.org/D4132 llvm-svn: 211441
* Revert "Lex: Use the correct types for MS integer suffixes"Rafael Espindola2014-06-211-13/+13
| | | | | | | | | This reverts commit r211426. This broke the arm bots. The crash can be reproduced on X86 by running. ./bin/clang -cc1 -fsyntax-only -verify -fms-extensions ~/llvm/clang/test/Lexer/ms-extensions.c -triple arm-linux llvm-svn: 211434
* Lex: Use the correct types for MS integer suffixesDavid Majnemer2014-06-211-13/+13
| | | | | | | | | | | | We didn't properly implement support for the sized integer suffixes. Suffixes like i16 were essentially ignored instead of mapping them to the appropriately sized integer type. This fixes PR20008. Differential Revision: http://reviews.llvm.org/D4132 llvm-svn: 211426
* Objective-C qoi. When Objective-C pointer mismatches withFariborz Jahanian2014-06-191-4/+31
| | | | | | | | a qualified-id type because pointer is object of a forward class declaration, include this info in a diagnostic note. // rdar://10751015 llvm-svn: 211324
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-181-1/+2
| | | | | | | | retainable ObjC pointers without requiring a bridge-cast in the context of pointer comparison as this is in effect a +0 context. // rdar://16627903 llvm-svn: 211243
* Objective-C. Attributes on class declarations carry overFariborz Jahanian2014-06-181-0/+6
| | | | | | | to forward class declarations for diagnosis. // rdar://16681279 llvm-svn: 211195
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-161-5/+9
| | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 llvm-svn: 211039
* Hide the concept of diagnostic levels from lex, parse and semaAlp Toker2014-06-151-13/+5
| | | | | | | | | | | | | | | | The compilation pipeline doesn't actually need to know about the high-level concept of diagnostic mappings, and hiding the final computed level presents several simplifications and other potential benefits. The only exceptions are opportunistic checks to see whether expensive code paths can be avoided for diagnostics that are guaranteed to be ignored at a certain SourceLocation. This commit formalizes that invariant by introducing and using DiagnosticsEngine::isIgnored() in place of individual level checks throughout lex, parse and sema. llvm-svn: 211005
* Recover from missing 'typename' in sizeof(T::InnerType)Reid Kleckner2014-06-121-10/+35
| | | | | | | | | | | | | | | | | | | | | | Summary: 'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or an expression. This change threads a RecoveryTSI parameter through the layers between TransformUnaryExprOrTypeTrait the point at which we look up the type. If lookup finds a single type result after instantiation, we now build TypeSourceInfo for it just like a normal transformation would. This fixes the last error in the hello world ATL app that I've been working with, and it now links and runs with clang. Please try it and file bugs! Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4108 llvm-svn: 210855
* Don't slice SemaDiagnosticBuilderReid Kleckner2014-06-111-3/+2
| | | | | | | I wasn't able to figure out how to emit this diagnostic from a SFINAE context, so I don't have a test. llvm-svn: 210713
* Allow lookup into dependent bases in more places under -fms-compatibilityReid Kleckner2014-06-111-22/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently allow unqualified lookup for instance methods but not static methods because we can't recover with a semantic 'this->' insertion. ATL headers have static methods that do unqualified lookup into dependent base classes. The pattern looks like: template <typename T> struct Foo : T { static int *getBarFromT() { return Bar; } }; Now we recover as if the user had written: template <typename T> struct Foo : T { static int *getBarFromT() { return Foo::Bar; } }; ... which will eventually look up Bar in T at instantiation time. Now we emit a diagnostic in both cases, and delay lookup in other contexts where 'this' is available and refers to a class with dependent bases. Reviewed by: rsmith Differential Revision: http://reviews.llvm.org/D4079 llvm-svn: 210611
* Related to PR19992: when the GNU alignof-expression extension is applied to anRichard Smith2014-06-101-4/+15
| | | | | | | expression of array-of-unknown-bound type, don't try to complete the array bound, and return the alignment of the element type rather than 1. llvm-svn: 210608
* Recover from missing typenames on template args for MSVC compatibilityReid Kleckner2014-06-101-0/+11
| | | | | | | | | | | | | While matching a non-type template argument against a known template type parameter we now modify the AST's TemplateArgumentLoc to assume the user wrote typename. Under -fms-compatibility, we downgrade our diagnostic from an error to an extwarn. Reviewed by: rsmith Differential Revision: http://reviews.llvm.org/D4049 llvm-svn: 210607
* PR19992: alignof is permitted on an array of unknown bound.Richard Smith2014-06-101-19/+16
| | | | llvm-svn: 210585
* Reduce indentation in ActOnIdExpression, NFCReid Kleckner2014-06-091-51/+48
| | | | llvm-svn: 210499
* Objective-C. Consider block pointer as NSObject as well as conforming toFariborz Jahanian2014-06-091-2/+33
| | | | | | | 'NSCopying' protocol when diagnosing block to ObjC pointer conversion. // rdar://16739120 llvm-svn: 210491
* Start adding support for dllimport/dllexport on classes (PR11170)Hans Wennborg2014-05-301-1/+1
| | | | | | | | | | | | | | | | This implements the central part of support for dllimport/dllexport on classes: allowing the attribute on class declarations, inheriting it to class members, and forcing emission of exported members. It's based on Nico Rieck's patch from http://reviews.llvm.org/D1099. This patch doesn't propagate dllexport to bases that are template specializations, which is an interesting problem. It also doesn't look at the rules when redeclaring classes with different attributes, I'd like to do that separately. Differential Revision: http://reviews.llvm.org/D3877 llvm-svn: 209908
* Objective-C. Diagnose assigning a block pointer type toFariborz Jahanian2014-05-301-2/+2
| | | | | | | an Objective-C object type other than 'id'. // rdar://16739120 llvm-svn: 209906
* PR12214 - Warn on suspicious self-compound-assignments.Nikola Smiljanic2014-05-301-1/+2
| | | | llvm-svn: 209867
* Refactoring. Remove Owned method from Sema.Nikola Smiljanic2014-05-291-136/+116
| | | | llvm-svn: 209812
* Refactoring. Remove release and take methods from ActionResult. Rename ↵Nikola Smiljanic2014-05-291-220/+220
| | | | | | takeAs to getAs. llvm-svn: 209800
* Consolidate some note diagnosticsAlp Toker2014-05-281-8/+6
| | | | | | | | | These note diags have the same message and can be unified further but for now let's just bring them together. Incidental change: Display a source range in the final attr diagnostic. llvm-svn: 209728
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-89/+94
| | | | llvm-svn: 209613
* PR19729: Delete a bunch of bogus code in Sema::FindAllocationOverload. ThisRichard Smith2014-05-131-14/+4
| | | | | | | | | caused us to perform copy-initialization for the parameters of an allocation function called by a new-expression multiple times, resulting in us rejecting allocations that passed non-copyable parameters (and much worse things in MSVC compat mode, where we potentially called this function multiple times). llvm-svn: 208724
* Add support for partial jump scope checkingAlp Toker2014-05-091-1/+0
| | | | | | | | | | This lets us diagnose and perform more complete semantic analysis when faced with errors in the function body or declaration. By recovering here we provide more consistent diagnostics, particularly during interactive editing. llvm-svn: 208394
OpenPOWER on IntegriCloud