summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Nitpicky refactoring -- use of nullptr and auto, made a bit more ↵Aaron Ballman2014-04-171-12/+12
| | | | | | const-correct. No functional changes intended. llvm-svn: 206491
* SemaTemplate.cpp: Rework r206451. Removing an argument was really bad idea.NAKAMURA Takumi2014-04-171-4/+5
| | | | llvm-svn: 206452
* SemaTemplate.cpp: Appease msvc to get rid of default argument in lambda ↵NAKAMURA Takumi2014-04-171-2/+2
| | | | | | | | definition. clang\lib\Sema\SemaTemplate.cpp(1826) : error C2064: term does not evaluate to a function taking 1 arguments llvm-svn: 206451
* PR19340: If we see a declaration of a member of an unspecialized class templateRichard Smith2014-04-171-39/+46
| | | | | | | that looks like it might be an explicit specialization, don't recover as an explicit specialization (bypassing the check that would reject that). llvm-svn: 206444
* Refactor all the checking for missing 'template<>'s when a declaration has aRichard Smith2014-04-173-82/+85
| | | | | | template-id after its scope specifier into a single place. llvm-svn: 206442
* Don't emit an ExtWarn on declarations of variable template specializations;Richard Smith2014-04-171-6/+6
| | | | | | | we'll already have issued the relevant diagnostic when we saw the declaration of the primary template. llvm-svn: 206441
* Implement [over.match.oper]p3 properly, by filtering the non-candidates outRichard Smith2014-04-178-120/+97
| | | | | | | when building the candidate set, rather than trying to contort name lookup into handling this. llvm-svn: 206436
* PR19452: Implement more of [over.match.oper]p3's restrictions on which ↵Richard Smith2014-04-172-17/+22
| | | | | | non-member overloaded operators can be found when no operand is of class type. We used to fail to implement this rule if there was an operand of dependent type. llvm-svn: 206435
* [objc] -[NSObject init] is documented to not do anything, don't warn if ↵Argyrios Kyrtzidis2014-04-161-2/+14
| | | | | | | | subclasses do not call [super init] on their initializers. Part of rdar://16568441 llvm-svn: 206410
* Sema: Factor out argument range checks for builtin functionsRichard Sandiford2014-04-161-109/+19
| | | | | | No behavioural change intended. llvm-svn: 206364
* Make -Wabsolute-value C++-aware.Richard Trieu2014-04-151-43/+104
| | | | | | | | Warn on std::abs() with unsigned argument. Suggest std::abs as replacement for the C absolute value functions. Suggest C++ headers if the specific std::abs overload is not found. llvm-svn: 206340
* Fix a comment to match the implementationAlp Toker2014-04-151-1/+1
| | | | llvm-svn: 206298
* Allow address space qualifiers on OpenCL array parametersFraser Cormack2014-04-151-2/+6
| | | | llvm-svn: 206275
* PR19178 __is_constructible returns true for abstract types.Nikola Smiljanic2014-04-151-0/+5
| | | | llvm-svn: 206273
* Test commit: minor formattingFraser Cormack2014-04-151-2/+1
| | | | llvm-svn: 206264
* Fix a bad interaction between -Wtautological-overlap-compare and delayedRichard Trieu2014-04-151-4/+11
| | | | | | diagnostics which caused delayed diagnostics on dead paths to be emitted. llvm-svn: 206232
* PR19415: Converting 'constexpr' to 'const' in a non-static data member can failRichard Smith2014-04-141-8/+13
| | | | | | if the member is already 'const'. Don't assert in that case. llvm-svn: 206205
* Improve error recovery around colon.Serge Pavlov2014-04-132-15/+72
| | | | | | | | | | Parse of nested name spacifier is modified so that it properly recovers if colon is mistyped as double colon in case statement. This patch fixes PR15133. Differential Revision: http://llvm-reviews.chandlerc.com/D2870 llvm-svn: 206135
* Fix diagnostics for C-style cast to function type.Logan Chien2014-04-131-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | If the C-style type cast is applied to the overloaded function and the destination type is function type, then Clang will crash with assertion failure. For example, void foo(int); void foo(int, int); void bar() { typedef void (ft)(int); ft p = (ft)foo; } In this case, the overloaded function foo will be cast to a function type, which should be considered as an error. But, unfortunately, since the function resolution is using canonical type, the matched function will be returned, and result in SEGV. This patch fixes this issue by removing the assertion and add some error diagnostics as the one in static_cast. llvm-svn: 206133
* Fix handling of redeclaration lookup for using declarations, where the priorRichard Smith2014-04-112-3/+13
| | | | | | | | | | | declaration is not visible. Previously we didn't find hidden friend names in this redeclaration lookup, because we forgot to treat it as a redeclaration lookup. Conversely, we did find some local extern names, but those don't actually conflict with a namespace-scope using declaration, because the only conflicts we can get are scope conflicts, not conflicts due to the entities being members of the same namespace. llvm-svn: 206011
* [Preprocessor/CodeComplete] Don't add include guard macros to ↵Argyrios Kyrtzidis2014-04-091-1/+6
| | | | | | code-completion results. llvm-svn: 205917
* [MS-ABI] Add support for #pragma section and related pragmasWarren Hunt2014-04-084-5/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the msvc pragmas section, bss_seg, code_seg, const_seg and data_seg as well as support for __declspec(allocate()). Additionally it corrects semantics and adds diagnostics for __attribute__((section())) and the interaction between the attribute and the msvc pragmas and declspec. In general conflicts should now be well diganosed within and among these features. In supporting the pragmas new machinery for uniform lexing for msvc pragmas was introduced. The new machinery always lexes the entire pragma and stores it on an annotation token. The parser is responsible for parsing the pragma when the handling the annotation token. There is a known outstanding bug in this implementation in C mode. Because these attributes and pragmas apply _only_ to definitions, we process them at the time we detect a definition. Due to tentative definitions in C, we end up processing the definition late. This means that in C mode, everything that ends up in a BSS section will end up in the _last_ BSS section rather than the one that was live at the time of tentative definition, even if that turns out to be the point of actual definition. This issue is not known to impact anything as of yet because we are not aware of a clear use or use case for #pragma bss_seg but should be fixed at some point. Differential Revision=http://reviews.llvm.org/D3065#inline-16241 llvm-svn: 205810
* 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
* Revert r205646 (keeping the test in its modified form) asFariborz Jahanian2014-04-071-10/+1
| | | | | | it is subsumed by r205521. llvm-svn: 205718
* Fix clang-tidy warning (argument comments don't match parameter names).Richard Smith2014-04-071-3/+3
| | | | llvm-svn: 205715
* Add a new subgroup to -Wtautological-compare, -Wtautological-overlap-compare,Richard Trieu2014-04-051-0/+39
| | | | | | | | | | | | | | which warns on compound conditionals that always evaluate to the same value. For instance, (x > 5 && x < 3) will always be false since no value for x can satisfy both conditions. This patch also changes the CFG to use these tautological values for better branch analysis. The test for -Wunreachable-code shows how this change catches additional dead code. Patch by Anders Rönnholm. llvm-svn: 205665
* Try harder about not suggesting methods as corrections when theyKaelyn Takata2014-04-043-33/+29
| | | | | | | | obviously won't work. Specifically, don't suggest methods (static or not) from unrelated classes when the expression is a method call through a specific object. llvm-svn: 205653
* Vector [Sema]. Vector "splats" which are truncated should have a warningFariborz Jahanian2014-04-041-1/+10
| | | | | | with -Wconversion. // rdar://16502418 llvm-svn: 205646
* In preparation for being able to use simple Boolean logic expressions ↵Aaron Ballman2014-04-041-15/+41
| | | | | | involving capabilities, the semantics for attributes now looks through the types of the constituent parts of a capability expression instead of at the aggregate expression type. llvm-svn: 205629
* [OPENMP][C++11] Renamed loop vars properly.Alexey Bataev2014-04-041-8/+8
| | | | llvm-svn: 205620
* Extend -Wtautological-constant-out-of-range-compare to handle boolean valuesRichard Trieu2014-04-041-74/+167
| | | | | | | | | | | | | | | better. This warning will now trigger on the following conditionals: bool b; int i; if (b > 1) {} // always false if (0 <= (i > 5)) {} // always true if (-1 > b) {} // always false Patch by Per Viberg. llvm-svn: 205608
* Turn off -Wmissing-noreturn warning for blocks Fariborz Jahanian2014-04-031-6/+2
| | | | | | | as there is no way to attach this attribute to the block literal. // rdar://16274746 llvm-svn: 205580
* vector [Sema]. Check for proper use of 's' char prefixFariborz Jahanian2014-04-031-1/+1
| | | | | | | (which indicates vector expression is a string of hex values) instead of crashing in code gen. // rdar://16492792 llvm-svn: 205557
* Teach getTemplateInstantiationPattern to deal with generic lambdas.Faisal Vali2014-04-031-2/+0
| | | | | | | | | | | | | No functionality change. When determining the pattern for instantiating a generic lambda call operator specialization - we must not go drilling down for the 'prototype' (i.e. as written) pattern - rather we must use our partially transformed pattern (whose DeclRefExprs are wired correctly to any enclosing lambda's decls that should be mapped correctly in a local instantiation scope) that is the templated pattern of the specialization's primary template (even though the primary template might be instantiated from a 'prototype' member-template). Previously, the drilling down was haltted by marking the instantiated-from primary template as a member-specialization (incorrectly). This prompted Richard to remark (http://llvm-reviews.chandlerc.com/D1784?id=4687#inline-10272) "It's a bit nasty to (essentially) set this bit incorrectly. Can you put the check into getTemplateInstantiationPattern instead?" In my reckless youth, I chose to ignore that comment. With the passage of time, I have come to learn the value of bowing to the will of the angry Gods ;) llvm-svn: 205543
* Improved semantics for implicit scalar -> extvector conversions.Stephen Canon2014-04-032-29/+36
| | | | llvm-svn: 205521
* [OPENMP] Small update for C++11Alexey Bataev2014-04-031-4/+2
| | | | llvm-svn: 205506
* If a using-declaration names a class member, but appears outside a class, tryRichard Smith2014-04-022-2/+51
| | | | | | to suggest a different syntax to get the same effect. llvm-svn: 205467
* PR19305: Don't issue -Wunused-variable warnings on variable templates. It's notRichard Smith2014-04-021-2/+4
| | | | | | | | | | | meaningful to odr-use the VarDecl inside a variable template. (Separately, it'd be nice to track referenced-ness for templates, and warn on unused ones, but that's really a distinct issue...) Move a test that generates and tests a warning-suppressing error out to its own test file, so it doesn't have weird effects on the other tests in the same file. llvm-svn: 205448
* Render anonymous entities as '(anonymous <thing>)' (and lambdas as '(lambda ↵David Blaikie2014-04-021-2/+2
| | | | | | | | | | | | at ... )') For namespaces, this is consistent with mangling and GCC's debug info behavior. For structs, GCC uses <anonymous struct> but we prefer consistency between all anonymous entities but don't want to confuse them with template arguments, etc, so we'll just go with parens in all cases. llvm-svn: 205398
* Updating the capability attribute diagnostics to be more capability-neutral. ↵Aaron Ballman2014-04-011-35/+46
| | | | | | Instead of using terminology such as "lock", "unlock" and "locked", the new terminology is "acquire", "release" and "held". Additionally, the capability attribute's name argument is now reported as part of the diagnostic, instead of hard coding as "mutex." llvm-svn: 205359
* Fix self-referential comment.Richard Smith2014-04-011-2/+1
| | | | llvm-svn: 205340
* Add defensive check that argument may be null in call to ↵Ted Kremenek2014-04-011-1/+1
| | | | | | | | | | | compareConversionFunctions() on incorrect code. I'm looking into getting a reduced test case, but it's not immediately available. Fixes <rdar://problem/16344806> llvm-svn: 205285
* Implement the 'optnone' attribute, which suppresses most optimizationsPaul Robinson2014-03-311-1/+24
| | | | | | on a function. llvm-svn: 205255
* Sema: Require external linkage for dll attributesNico Rieck2014-03-311-0/+16
| | | | llvm-svn: 205198
* Sema: Check dll attributes on redeclarationsNico Rieck2014-03-311-11/+62
| | | | | | | A redeclaration may not add dllimport or dllexport attributes. dllexport is sticky and can be omitted on redeclarations while dllimport cannot. llvm-svn: 205197
* [OPENMP] Implemented 'copyin' clauseAlexey Bataev2014-03-312-3/+126
| | | | llvm-svn: 205164
* Sema: Implement DR317David Majnemer2014-03-301-0/+8
| | | | | | | | | | | | | | | Summary: Declaring a function as inline after it has been defined is in violation of [dcl.fct.spec]p4. The program would get a strong definition instead of getting a function with linkonce_odr linkage. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3220 llvm-svn: 205129
* ARM64: initial clang support commit.Tim Northover2014-03-292-21/+55
| | | | | | | | | | | This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. llvm-svn: 205100
* Improve -Wunreachable-code to provide a means to indicate code is ↵Ted Kremenek2014-03-291-1/+14
| | | | | | | | | | | | | | | | | | intentionally marked dead via if((0)). Taking a hint from -Wparentheses, use an extra '()' as a sigil that a dead condition is intentionally dead. For example: if ((0)) { dead } When this sigil is found, do not emit a dead code warning. When the analysis sees: if (0) it suggests inserting '()' as a Fix-It. llvm-svn: 205069
* Add ARM big endian Target (armeb, thumbeb)Christian Pirker2014-03-281-0/+2
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3096 llvm-svn: 205008
OpenPOWER on IntegriCloud