summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add an assertion for detecting missed/uncorrected TypoExprs.Kaelyn Takata2014-11-211-0/+2
| | | | llvm-svn: 222552
* Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata2014-11-212-15/+39
| | | | | | when calling DiagnoseEmptyLookup. llvm-svn: 222551
* Properly correct initializer expressions based on whether they would be valid.Kaelyn Takata2014-11-211-0/+17
| | | | llvm-svn: 222550
* Use the full-Expr filter to disambiguate equidistant correctionKaelyn Takata2014-11-211-26/+41
| | | | | | candidates. llvm-svn: 222549
* [OPENMP] Disable CapturedStmt generation for standalone directives.Alexey Bataev2014-11-211-32/+4
| | | | | | No functional changes, just code improvement. llvm-svn: 222523
* Fix missing diagnostic for unsupported TLS for some thread_local variables.Bob Wilson2014-11-211-16/+14
| | | | | | | | | Clang r181627 moved a check for block-scope variables into this code for handling thread storage class specifiers, but in the process, it broke the logic for checking if the target supports TLS. Fix this with some simple restructuring of the code. rdar://problem/18796883 llvm-svn: 222512
* Extend -Wuninitialized to warn when accessing uninitialized base classes in aRichard Trieu2014-11-211-12/+41
| | | | | | constructor. llvm-svn: 222503
* Remove code that tries to avoid transforming non-dependent call operator typesRichard Smith2014-11-201-78/+24
| | | | | | | | | | for lambda expressions. That can't ever work; we need to transform the parameters in order to create new ones in the new call operator context. Fixes a rejects-valid when transforming a context containing a lambda-expression that uses its function parameters in C++14 mode. llvm-svn: 222482
* Fix crash-on-valid if a lambda-expression appears lexically directly within aRichard Smith2014-11-201-1/+4
| | | | | | local class inside a template. llvm-svn: 222476
* Ensure all TypoExprs are diagnosed by the tree transform.Kaelyn Takata2014-11-201-0/+16
| | | | | | | | | | | | If there is more than one TypoExpr within the expr being transformed and any but the last TypoExpr seen don't have any viable candidates, the tree transform will be aborted early and the remaining TypoExprs are never seen and hence never diagnosed. This adds a simple RecursiveASTVisitor to find all of the TypoExprs to be diagnosed in the case where typo correction of the entire expr fails (and the result of the tree transform is an ExprError). llvm-svn: 222465
* Wire up delayed typo correction to DiagnoseEmptyLookup and set upKaelyn Takata2014-11-202-9/+106
| | | | | | | | | Sema::ActOnIdExpression to use the new functionality. Among other things, this allows recovery in several cases where it wasn't possible before (e.g. correcting a mistyped static_cast<>). llvm-svn: 222464
* Add a flag to BuildDeclarationNameExpr to not reject invalid decls.Kaelyn Takata2014-11-202-8/+10
| | | | llvm-svn: 222463
* Factor out the default recovery handling.Kaelyn Takata2014-11-201-14/+77
| | | | | | | | | | | The default handling is extended to properly create member expressions and Objective-C ivar references. Also detect and reject cases where multiple corrections have identical correction distances and are valid, instead of suggesting the first one that is found. llvm-svn: 222462
* Correctly set the SourceRange a TypoCorrection will replace.Kaelyn Takata2014-11-201-3/+5
| | | | | | Also clean up TypoCorrection::setCorrectionRange while we're at it. llvm-svn: 222460
* Testing commit access.Anastasia Stulova2014-11-201-1/+1
| | | | llvm-svn: 222438
* PR21531: fix crash on invalid with unexpanded pack in case value.Richard Smith2014-11-201-8/+13
| | | | llvm-svn: 222400
* Update for LLVM API change to make Small(Ptr)Set::insert return ↵David Blaikie2014-11-1913-72/+80
| | | | | | pair<iterator, bool> as per the C++ standard's associative container concept. llvm-svn: 222335
* Add the exception for strings in logical and expressions to -Wstring-conversionRichard Trieu2014-11-191-2/+9
| | | | | | for C code. llvm-svn: 222327
* clang-format a recent commit I madeDavid Blaikie2014-11-191-4/+4
| | | | llvm-svn: 222317
* Wrap to 80 columns, no behavior change.Nico Weber2014-11-193-9/+10
| | | | llvm-svn: 222315
* [Sema] Patch to issue warning on comparing parameters withFariborz Jahanian2014-11-183-1/+54
| | | | | | | | | | | nonnull attribute when comparison is always true/false. Original patch by Steven Wu. I have added extra code to prevent issuing of warning when the nonnull parameter is modified prior to the comparison. This addition prevents false positives in the most obvious cases. There may still be false positive warnings in some cases (as one of my tests indicates), but benefit far outweighs such cases. rdar://18712242 llvm-svn: 222264
* [OPENMP] Additional processing of 'omp atomic read' directive.Alexey Bataev2014-11-181-5/+87
| | | | | | According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it. llvm-svn: 222231
* Fix an assertion when ending a function definition.John McCall2014-11-181-1/+2
| | | | | | | | | | | | | | | | | | | | The bug is that ExprCleanupObjects isn't always empty in a fresh evaluation context. New evaluation contexts just track the current depth of the stack. The assertion will misfire whenever we finish processing a function body inside an expression that contained an earlier block literal with non-trivial captures. That's actually a lot less likely than you'd think, though, because it has to be a real function declaration, not just another block. Mixed block/lambda code would work, as would a template instantiation or a local class definition. The code works correctly if the assertion is disabled. rdar://16356628 llvm-svn: 222194
* Handle use of default member initializers before end of outermost classReid Kleckner2014-11-173-63/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, when we have this situation: struct A { template <typename T> struct B { int m1 = sizeof(A); }; B<int> m2; }; We can't parse m1's initializer eagerly because we need A to be complete. Therefore we wait until the end of A's class scope to parse it. However, we can trigger instantiation of B before the end of A, which will attempt to instantiate the field decls eagerly, and it would build a bad field decl instantiation that said it had an initializer but actually lacked one. Fixed by deferring instantiation of default member initializers until they are needed during constructor analysis. This addresses a long standing FIXME in the code. Fixes PR19195. Reviewed By: rsmith Differential Revision: http://reviews.llvm.org/D5690 llvm-svn: 222192
* Missing comma in a string array initialization (CID 1254893)Sylvestre Ledru2014-11-171-1/+1
| | | | | | | | | | | | | | Summary: We have this error from a while (Wed Jun 15 18:02:42 2011 r133103) Reviewers: rsmith Reviewed By: rsmith Differential Revision: http://reviews.llvm.org/D6296 llvm-svn: 222169
* Fix the indentation: Nesting level does not match indentation (CID 1254863)Sylvestre Ledru2014-11-171-2/+2
| | | | llvm-svn: 222152
* Fix issues missed during the review of r222099.Richard Trieu2014-11-151-15/+17
| | | | | | | Shift some functions around, make a method in Sema private, call the correct overloaded function. No functional change. llvm-svn: 222081
* [c++1z] Support [[deprecated]] attributes on namespaces. Note that it only ↵Aaron Ballman2014-11-143-7/+32
| | | | | | applies to situations where the namespace is mentioned. Thus, use on anonymous namespaces is diagnosed. llvm-svn: 222054
* Recommit r222044 with a test fix - it does not make sense to huntAnton Korobeynikov2014-11-143-26/+80
| | | | | | for a typedef before arithmetic conversion in all rare corner cases. llvm-svn: 222049
* Again revert r222044 to resolve darwin objc test fails.Anton Korobeynikov2014-11-143-80/+26
| | | | llvm-svn: 222047
* Follow-up to D6217Anton Korobeynikov2014-11-143-26/+80
| | | | | | | | | | | | | | | | | Summary: Ok, here is somewhat addition to D6217 aiming to preserve old darwin behavior wrt the typedefed types. The actual change to SemaChecking turned out to be pretty gross, in particular: 1. We need to extract the typedef'ed type for proper diagnostics 2. We need to walk over paren expressions as well Reviewers: chandlerc, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6256 llvm-svn: 222044
* Remove some redundant virtual specifiers on overriden functions.David Blaikie2014-11-142-10/+10
| | | | llvm-svn: 222024
* Typo fix.Yaron Keren2014-11-141-1/+1
| | | | llvm-svn: 222016
* [Sema]. Warn when logical expression is a pointerFariborz Jahanian2014-11-142-0/+20
| | | | | | | which evaluates to true. rdar://18716393. Reviewed by Richard Trieu llvm-svn: 222009
* [OPENMP] Temporary fix for processing of global variables in loops.Alexey Bataev2014-11-141-1/+12
| | | | | | Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted. llvm-svn: 221970
* PR21565 Add an egregious hack to support broken libstdc++ headers that declareRichard Smith2014-11-141-0/+27
| | | | | | | | | | | | a member named 'swap' and then expect unqualified lookup for the name 'swap' in its exception specification to find anything else. Without delay-parsed exception specifications, this was ill-formed (NDR) by [basic.scope.class]p1, rule 2. With delay-parsed exception specifications, the call to 'swap' unambiguously finds the function being declared, which then fails because the arguments don't work for that function. llvm-svn: 221955
* -Wsentinel: Suggest nullptr in C++11 instead of NULLReid Kleckner2014-11-131-2/+4
| | | | llvm-svn: 221945
* Objective-C. Fixes a regression caused by implementationFariborz Jahanian2014-11-132-4/+16
| | | | | | | | of new warning for deprecated method call for receiver of type 'id'. This addresses rdar://18960378 where unintended warnings being issued. llvm-svn: 221933
* PR21437, final part of DR1330: delay-parsing of exception-specifications. ThisRichard Smith2014-11-135-31/+88
| | | | | | | is a re-commit of Doug's r154844 (modernized and updated to fit into current Clang). llvm-svn: 221918
* PR19372: Keep checking template arguments after we see an argument packRichard Smith2014-11-121-28/+11
| | | | | | | | expansion into a parameter pack; we know that we're still filling in that parameter's arguments. Previously, if we hit this case for an alias template, we'd try to substitute using non-canonical template arguments. llvm-svn: 221832
* Temporary revert r221818 until all the problemsAnton Korobeynikov2014-11-122-13/+5
| | | | | | with objc stuff will be resolved. llvm-svn: 221829
* Fix fallout from r219557Anton Korobeynikov2014-11-122-5/+13
| | | | | | | | | | | | | | | | | Summary: Consider the following nifty 1 liner: (0 ? csqrtl(2.0f) : sqrtl(2.0f)). One can easily obtain such code from e.g. tgmath. Right now it produces an assertion because we fail to do the promotion real => _Complex real. The case was properly handled previously (old handleOtherComplexFloatConversion routine), but was forgotten in the current version. This seems to be about fallout from r219557 Reviewers: chandlerc, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6217 llvm-svn: 221821
* Fix brace init of unions with unnamed struct membersReid Kleckner2014-11-121-2/+3
| | | | | | | | The check for unnamed members was intended to skip unnamed bitfields, but it ended up skipping unnamed structs. This lead to an assertion in IRGen. llvm-svn: 221818
* Pass the filter function_ref by value now that r221753 fixes the bugKaelyn Takata2014-11-121-3/+3
| | | | | | that was preventing pass-by-value from working correctly. llvm-svn: 221803
* Mark TypeDecls used in explicit destructor calls as referenced.Nico Weber2014-11-121-0/+1
| | | | | | Fixes PR21221. Patch by Axel Naumann, test by me. llvm-svn: 221771
* Mark TypeDecls used in member initializers as referenced.Nico Weber2014-11-121-0/+1
| | | | | | | | | | | | | | | | | | Without this, -Wunused-local-typedef would incorrectly warn on the two typedefs in this program: void foo() { struct A {}; struct B : public A { typedef A INHERITED; B() : INHERITED() {} typedef B SELF; B(int) : SELF() {} }; } llvm-svn: 221765
* clang-format a few lines, fixes one 80col violation. nfc.Nico Weber2014-11-121-6/+5
| | | | llvm-svn: 221764
* Try a different workaround for GCC 4.7.2 lambda capture bug. The previousRichard Smith2014-11-121-7/+8
| | | | | | workaround took us from wrong-code to ICE. llvm-svn: 221754
* Instantiate exception specifications when instantiating function types (otherRichard Smith2014-11-126-190/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | than the type of a function declaration). We previously didn't instantiate these at all! This also covers the pathological case where the only mention of a parameter pack is within the exception specification; this gives us a second way (other than alias templates) to reach the horrible state where a type contains an unexpanded pack, but its canonical type does not. This is a re-commit of r219977: r219977 was reverted in r220038 because it hit a wrong-code bug in GCC 4.7.2. (That's gcc.gnu.org/PR56135, and affects any implicit lambda-capture of 'this' within a template.) r219977 was a re-commit of r217995, r218011, and r218053: r217995 was reverted in r218058 because it hit a rejects-valid bug in MSVC. (Incorrect overload resolution in the presence of using-declarations.) It was re-committed in r219977 with a workaround for the MSVC rejects-valid. r218011 was a workaround for an MSVC parser bug. (Incorrect desugaring of unbraced range-based for loop). llvm-svn: 221750
* PR21536: Fix a corner case where we'd get confused by a pack expanding into theRichard Smith2014-11-121-1/+1
| | | | | | | penultimate parameter of a template parameter list, where the last parameter is itself a pack, and build a bogus empty final pack argument. llvm-svn: 221748
OpenPOWER on IntegriCloud