summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* ObjectiveC. Fixes a bogus warning of unused backingFariborz Jahanian2013-11-151-1/+10
| | | | | | | | ivar when property belongs to a super class and currnt class happens to have a method with same name as property. // rdar//15473432 llvm-svn: 194830
* When we hit a #include directive that maps to a module import, emit a tokenRichard Smith2013-11-151-0/+6
| | | | | | | | | | | | representing the module import rather than making the module immediately visible. This serves two goals: * It avoids making declarations in the module visible prematurely, if we walk past the #include during a tentative parse, for instance, and * It gives a diagnostic (although, admittedly, not a very nice one) if a header with a corresponding module is included anywhere other than at the top level. llvm-svn: 194782
* PR17533 and duplicates: don't compute the return type of an overloaded operatorRichard Smith2013-11-152-16/+20
| | | | | | | until after we've referenced the operator; otherwise, we might pick up a not-yet-deduced type. llvm-svn: 194775
* Don't reject dependent range-based for loops in constexpr functions. The loopRichard Smith2013-11-151-1/+1
| | | | | | variable isn't really uninitialized, it's just not initialized yet. llvm-svn: 194767
* [OpenCL] Make sure we put string literals in the constant address space.Joey Gouly2013-11-141-0/+5
| | | | llvm-svn: 194717
* Revert r194663 and r194647.Ted Kremenek2013-11-141-12/+0
| | | | | | Per feedback from Jordan Rose I realized this wasn't the right way to go. llvm-svn: 194664
* Refine -Wunused-variable to only suppress warning for __bridge_transfer, not ↵Ted Kremenek2013-11-141-14/+4
| | | | | | | | | all bridge casts. Also refine test case to capture the intention of this suppression. Essentially some developers use __bridge_transfer as if it were a safe CFRelease. llvm-svn: 194663
* [AArch64 neon] support poly64 and relevant intrinsic functions.Kevin Qin2013-11-142-8/+13
| | | | llvm-svn: 194660
* Added warning on structures/unions that are empty or contain onlySerge Pavlov2013-11-141-13/+29
| | | | | | | | | | bit fields of zero size. Warnings are generated in C++ mode and if only such type is defined inside extern "C" block. The patch fixed PR5065. Differential Revision: http://llvm-reviews.chandlerc.com/D2151 llvm-svn: 194653
* Suppress -Wunused-variable when initializer uses bridge casts for memory ↵Ted Kremenek2013-11-141-0/+22
| | | | | | | | management. Fixes <rdar://problem/15432770>. llvm-svn: 194647
* ObjectiveC ARC. objc_bridge attribute should be applied toFariborz Jahanian2013-11-141-4/+3
| | | | | | toll-free bridging cf types only. // rdar//15454846 wip. llvm-svn: 194640
* ObjectiveC ARC. Introduce a new attribute, 'objc_bridge'Fariborz Jahanian2013-11-131-0/+53
| | | | | | | that teaches the compiler about a subset of toll-free bridging semantics. This is wip. // rdar://15454846 llvm-svn: 194633
* Warn on duplicate function specifierSerge Pavlov2013-11-131-12/+56
| | | | | | | | | This patch fixes PR8264. Duplicate qualifiers already are diagnozed, now the same diagnostics is issued for duplicate function specifiers. Differential Revision: http://llvm-reviews.chandlerc.com/D2025 llvm-svn: 194559
* PR10837: Warn if a null pointer constant is formed by a zero integer constantRichard Smith2013-11-131-2/+11
| | | | | | expression that is not a zero literal, in C. Patch by Ivan A. Kosarev! llvm-svn: 194540
* add intrinsics: __builtin_arm_{dmb,dsb} for ARMWeiming Zhao2013-11-121-0/+2
| | | | llvm-svn: 194513
* COSMETIC: Fix 80 column overflow in some comments introduced in r194188Faisal Vali2013-11-121-7/+7
| | | | | | no functionality change. llvm-svn: 194449
* A quick fix to PR17877 that was introduced by r194188 ↵Faisal Vali2013-11-121-3/+18
| | | | | | | | | | | | | | | | (generic-lambda-capturing) that broke libc++. See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033369.html for discussion on cfe-dev. This fix explicitly checks whether we are within the declcontext of a lambda's call operator - which is what I had intended to be true (and assumed would be true if getCurLambda returns a valid pointer) before checking whether a lambda can capture the potential-captures of the innermost lambda. A deeper fix (that addresses why getCurLambda() returns a valid pointer when perhaps it shouldn't?) - as proposed by Richard Smith in http://llvm.org/bugs/show_bug.cgi?id=17877 - has been suggested as a FIXME. Patch was LGTM'd by Richard (just barely :) http://llvm-reviews.chandlerc.com/D2144 llvm-svn: 194448
* Rather than duplicating extension diagnostics to allow them to cause aRichard Smith2013-11-122-21/+11
| | | | | | | | | | substitution failure, allow a flag to be set on the Diagnostic object, to mark it as 'causes substitution failure'. Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior rather than a bunch of flags. llvm-svn: 194444
* COSMETIC: Right justify an asterix in the previous refactoring.Faisal Vali2013-11-121-1/+1
| | | | | | | | Hopefully Richard won't notice this terrible egregiocity - clearly the work of a malevolent poltergeist - fixed now ;) No functionality change. llvm-svn: 194439
* REFACTOR: Have PushLambdaScope return the LambdaScopeInfo that it creates.Faisal Vali2013-11-123-6/+7
| | | | | | | | No Functionality change. This refactoring avoids having to call getCurLambda right after PushLambdaScope, to obtain the LambdaScopeInfo that was created during the call to PushLambdaScope. llvm-svn: 194438
* Issue a diagnostic if we see a templated friend declaration that we do notRichard Smith2013-11-082-3/+6
| | | | | | support. llvm-svn: 194273
* s/DebugPrint/dump/gDouglas Gregor2013-11-082-12/+12
| | | | llvm-svn: 194242
* Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained ↵Douglas Gregor2013-11-082-9/+27
| | | | | | | | | | | | | reference. Under ARC++, a reference to a const Objective-C pointer is implicitly treated as __unsafe_unretained, and can be initialized with (e.g.) a __strong lvalue. Make sure this behavior does not break template argument deduction and (related) that partial ordering still prefers a 'T* const&' template over a 'T const&' template when this case kicks in. Fixes <rdar://problem/14467941>. llvm-svn: 194239
* Fix a bogus assert I introduced in r194224Douglas Gregor2013-11-081-1/+1
| | | | llvm-svn: 194237
* Re-instate contextual conversion to Objective-C pointers in message sends.Douglas Gregor2013-11-072-31/+96
| | | | | | | | | When performing an Objective-C message send to a value of class type, perform a contextual conversion to an Objective-C pointer type. We've had this for a long time, but it recently regressed. Fixes <rdar://problem/15234703>. llvm-svn: 194224
* PR17800: When performing pack expansion, we must always rebuild the AST nodesRichard Smith2013-11-071-1/+5
| | | | | | | to avoid breaking AST invariants by reusing Stmt nodes within the same function. llvm-svn: 194217
* Remove an unnecessary condition that I added hastily: Unsigned numbers are ↵Faisal Vali2013-11-071-1/+1
| | | | | | | | obviously >= 0 ;) Also - others have complained about some white space issues - sorry about that - continues to be a pain point for me - will try and see what I can do with clang-format this evening after work - as a short term fix, if anyone can email me the files that they have already identified with issues, it would help me speed up a focused fix. sorry. llvm-svn: 194206
* Add parens for || in && in assert. No functionality change.Benjamin Kramer2013-11-071-2/+2
| | | | llvm-svn: 194200
* Fixed bug in return type of __builtin_va_start().Enea Zaffanella2013-11-071-0/+1
| | | | llvm-svn: 194197
* Unbreak the Clang -Werror build by removing some unused variablesDavid Blaikie2013-11-071-11/+6
| | | | llvm-svn: 194190
* This patch implements capturing of variables within generic lambdas.Faisal Vali2013-11-076-57/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both Richard and I felt that the current wording in the working paper needed some tweaking - Please see http://llvm-reviews.chandlerc.com/D2035 for additional context and references to core-reflector messages that discuss wording tweaks. What is implemented is what we had intended to specify in Bristol; but, recently felt that the specification might benefit from some tweaking and fleshing. As a rough attempt to explain the semantics: If a nested lambda with a default-capture names a variable within its body, and if the enclosing full expression that contains the name of that variable is instantiation-dependent - then an enclosing lambda that is capture-ready (i.e. within a non-dependent context) must capture that variable, if all intervening nested lambdas can potentially capture that variable if they need to, and all intervening parent lambdas of the capture-ready lambda can and do capture the variable. Of note, 'this' capturing is also currently underspecified in the working paper for generic lambdas. What is implemented here is if the set of candidate functions in a nested generic lambda includes both static and non-static member functions (regardless of viability checking - i.e. num and type of parameters/arguments) - and if all intervening nested-inner lambdas between the capture-ready lambda and the function-call containing nested lambda can capture 'this' and if all enclosing lambdas of the capture-ready lambda can capture 'this', then 'this' is speculatively captured by that capture-ready lambda. Hopefully a paper for the C++ committee (that Richard and I had started some preliminary work on) is forthcoming. This essentially makes generic lambdas feature complete, except for known bugs. The more prominent ones (and the ones I am currently aware of) being: - generic lambdas and init-captures are broken - but a patch that fixes this is already in the works ... - nested variadic expansions such as: auto K = [](auto ... OuterArgs) { vp([=](auto ... Is) { decltype(OuterArgs) OA = OuterArgs; return 0; }(5)...); return 0; }; auto M = K('a', ' ', 1, " -- ", 3.14); currently cause crashes. I think I know how to fix this (since I had done so in my initial implementation) - but it will probably take some work and back & forth with Doug and Richard. A warm thanks to all who provided feedback - and especially to Doug Gregor and Richard Smith for their pivotal guidance: their insight and prestidigitation in such matters is boundless! Now let's hope this commit doesn't upset the buildbot gods ;) Thanks! llvm-svn: 194188
* [-fms-extensions] Add support for __FUNCDNAME__David Majnemer2013-11-061-0/+1
| | | | | | | | | | | | | | | | Summary: Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled function name via __FUNCDNAME__. This implementation is very naive and unoptimized, it is expected that __FUNCDNAME__ would be used rarely in practice. Reviewers: rnk, rsmith, thakis CC: cfe-commits, silvas Differential Revision: http://llvm-reviews.chandlerc.com/D2109 llvm-svn: 194181
* Fix diagnostic goof in r194161.Richard Smith2013-11-061-2/+2
| | | | llvm-svn: 194162
* Add a limit to the length of a sequence of 'operator->' functions we willRichard Smith2013-11-061-6/+41
| | | | | | | follow when building a class member access expression. Based on a patch by Rahul Jain! llvm-svn: 194161
* Simplify: we don't care why constant evaluation might have failed when we'reRichard Smith2013-11-051-4/+2
| | | | | | checking an expression for constant overflow. llvm-svn: 194099
* Do not allow functions or kernels called 'main' in OpenCL.Joey Gouly2013-11-051-0/+7
| | | | llvm-svn: 194068
* Sema: Improve comment introduced in r193397David Majnemer2013-11-051-0/+5
| | | | llvm-svn: 194052
* ObjectiveC. Method implementations should only check forFariborz Jahanian2013-11-051-3/+1
| | | | | | | "Missing call to Super" in the overriding method and not in the method itself. // rdar://15385981. llvm-svn: 194031
* Issue a diagnostic if an implicitly-defined move assignment operator would moveRichard Smith2013-11-041-10/+99
| | | | | | | the same virtual base class multiple times (and the move assignment is used, and the move assignment for the virtual base is not trivial). llvm-svn: 193977
* Update a comment to match current core issues list.Richard Smith2013-11-041-8/+3
| | | | llvm-svn: 193970
* Implement final resolution of DR1402: implicitly-declared move operators thatRichard Smith2013-11-043-157/+33
| | | | | | | | | | | would be deleted are still declared, but are ignored by overload resolution. Also, don't delete such members if a subobject has no corresponding move operation and a non-trivial copy. This causes us to implicitly declare move operations in more cases, but risks move-assigning virtual bases multiple times in some circumstances (a warning for that is to follow). llvm-svn: 193969
* Sema: Do not allow overloading between methods based on restrictDavid Majnemer2013-11-031-1/+6
| | | | | | | | | | | | | | | | If the sole distinction between two declarations is that one has a __restrict qualifier then we should not consider it to be an overload. Instead, we will consider it as an incompatible redeclaration which is similar to how MSVC, ICC and GCC would handle it. This fixes PR17786. N.B. We must not mangle in __restrict into method qualifiers becase we don't allow overloading between such declarations anymore. To do otherwise would be a violation of the Itanium ABI. llvm-svn: 193964
* Sema: Disallow inheriting from classes with flexible array membersDavid Majnemer2013-11-021-0/+12
| | | | | | | | | | | Flexible array members inherently index off of the end of their parent type. We shouldn't allow this type to be used as a base, virtual or otherwise, because indexing off the end may find us inside of another base or the derived types members. llvm-svn: 193923
* Sema: Remove stray whitespace around Sema::CheckBaseSpecifierDavid Majnemer2013-11-021-3/+3
| | | | llvm-svn: 193922
* Sema: Disallow derived classes with virtual bases from having flexible array ↵David Majnemer2013-11-021-0/+9
| | | | | | | | | | | | | | | members Flexible array members only work out if they are the last field of a record, however virtual bases would give us many situations where the flexible array member would overlap with the virtual base fields. It is unlikely in the extreme that this behavior was intended by the user so raise a diagnostic instead of accepting. This is will not reject conforming code because flexible array members are an extension in C++ mode. llvm-svn: 193920
* Sema: Cleanup and simplify anonymous union diagnosticsDavid Majnemer2013-11-021-34/+23
| | | | | | | | | | | | | | | | The determination of which diagnostics would be issued for certain anonymous unions started to get a little ridiculous. Clean this up by inverting the condition-tree's logic from dialect -> issue to issue -> diagnostic. As part of this cleanup, move ext_c99_flexible_array_member from DiagnosticParseKinds.td to DiagnosticSemaKinds.td because it's driven by Sema, not Parse. Also, the liberty was taken to edit ext_c99_flexible_array_member to match other, similar, diagnostics. llvm-svn: 193919
* Sema: Flexible array members were introduced in C99, diagnose their use in C++David Majnemer2013-11-021-0/+6
| | | | | | | The declaration of a flexible array member was correctly diagnosed as an extension in C89 mode but not in C++. llvm-svn: 193918
* Sema: Properly indent statements in Sema::ActOnLastBitfieldDavid Majnemer2013-11-021-6/+6
| | | | llvm-svn: 193917
* Sema: trim trailing whitespace in Sema::ActOnLastBitfieldDavid Majnemer2013-11-021-4/+4
| | | | llvm-svn: 193916
* Change the other -Wtautological-compare warnings to not trigger in templateRichard Trieu2013-11-021-2/+4
| | | | | | | specializations. Also switch to -Wuninitialized for a test case that depended on a warning firing in template specializations. llvm-svn: 193906
OpenPOWER on IntegriCloud