summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Add an Extension warning for applying unary * to an operand of type 'void*' inRichard Smith2014-05-071-4/+13
| | | | | | | C++. This seems like a pointless (and indeed harmful) restriction to me, so I've suggested removing it to -core and disabled this diagnostic by default. llvm-svn: 208254
* Wrap a few lines at 80 columns, change a confusing indent. No behavior change.Nico Weber2014-05-031-8/+7
| | | | llvm-svn: 207921
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-2/+2
| | | | llvm-svn: 207896
* AST: Mangle reference temporaries reliablyDavid Majnemer2014-05-011-1/+1
| | | | | | | | | | | | | | | Summary: Previously, we would generate a single name for all reference temporaries and allow LLVM to rename them for us. Instead, number the reference temporaries as we build them in Sema. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3554 llvm-svn: 207776
* Objective-C. Improve diagnosis of bridging types.Fariborz Jahanian2014-04-291-0/+2
| | | | | | // rdar://16737117 llvm-svn: 207542
* [SemaCXX] Silence -Wconstant-logical-operand if the operand is a 0/1 from a ↵Argyrios Kyrtzidis2014-04-281-1/+2
| | | | | | | | | | | macro. Libraries specify enabled/disabled features using macro defs of 0/1, in such cases the -Wconstant-logical-operand is noise. rdar://15410291 llvm-svn: 207386
* [Sema] Adjust Sema::getCurBlock()/getCurLambda() to take into account that ↵Argyrios Kyrtzidis2014-04-261-1/+1
| | | | | | | | | | | we may have switch CurContext due to class template instantiation. Fixes crash of the included test case. rdar://16527205 llvm-svn: 207325
* Initial implementation of -modules-earch-all option, for searching for ↵John Thompson2014-04-231-2/+3
| | | | | | symbols in non-imported modules. llvm-svn: 206977
* Implement [over.match.oper]p3 properly, by filtering the non-candidates outRichard Smith2014-04-171-2/+3
| | | | | | | when building the candidate set, rather than trying to contort name lookup into handling this. llvm-svn: 206436
* Add support for MSVC's __FUNCSIG__Reid Kleckner2014-04-081-0/+1
| | | | | | | | | | | It is very similar to GCC's __PRETTY_FUNCTION__, except it prints the calling convention. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D3311 llvm-svn: 205780
OpenPOWER on IntegriCloud