summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Sema: Don't crash when __try/__except/__finally appears in a template functionDavid Majnemer2013-10-151-3/+6
| | | | | | | | | | | We wouldn't transform the compound statement in any of these forms, causing crashes when it got time to act on them. Additionally, we wouldn't check to see if the handler was invalid before deciding whether or not we should continue acting on the __try. This fixes PR17584. llvm-svn: 192682
* Sema: Consider it an error to apply __builtin_offsetof to a member in a ↵David Majnemer2013-10-151-2/+8
| | | | | | | | | | virtual base icc 13 and g++ 4.9 both reject this while we would crash. Fixes PR17578. llvm-svn: 192674
* Special case '%C' handling in ObjC format strings to handle integer literals ↵Ted Kremenek2013-10-151-1/+9
| | | | | | | | that can represent unicode characters Fixes <rdar://problem/13991617>. llvm-svn: 192673
* PR17567: Improve diagnostic for a mistyped constructor name. If we see somethingRichard Smith2013-10-151-0/+26
| | | | | | | | | | | that looks like a function declaration, except that it's missing a return type, try typo-correcting it to the relevant constructor name. In passing, fix a bug where the missing-type-specifier recovery codepath would drop a preceding scope specifier on the floor, leading to follow-on diagnostics and incorrect recovery for the auto-in-c++98 hack. llvm-svn: 192644
* Trivial formatting changes; no functional changes intended.Aaron Ballman2013-10-141-4/+6
| | | | llvm-svn: 192640
* Switching some custom logic to using table-generated helper methods. This ↵Aaron Ballman2013-10-141-23/+11
| | | | | | also removes an unnecessary diagnostic. llvm-svn: 192639
* Move comment to its proper place.Ted Kremenek2013-10-141-2/+2
| | | | llvm-svn: 192613
* GetExprRange() (used by -Wconversion checking) should look through ↵Ted Kremenek2013-10-141-0/+3
| | | | | | | | | | OpaqueValueExprs. Fixes a false positive with -Wconversion involving Objective-C properties. Fixes <rdar://problem/14415662>. llvm-svn: 192611
* Reduce double set lookups by using the result of insert.Benjamin Kramer2013-10-141-8/+7
| | | | | | No functionality change. llvm-svn: 192598
* Do not use typo correction that is unaccessible.Serge Pavlov2013-10-141-2/+9
| | | | | | | | This patch fixes PR17019. When doing typo correction, Sema::CorrectTypo uses correction already seen for the same typo. This causes problems if that correction is from another scope and cannot be accessed in the current. llvm-svn: 192594
* Consumed analysis: replace the consumes attribute with a set_typestateDeLesley Hutchins2013-10-111-58/+84
| | | | | | attribute. Patch by chris.wailes@gmail.com; reviewed and edited by delesley. llvm-svn: 192515
* Consumed analysis: switch from tests_consumed/unconsumed to a generalDeLesley Hutchins2013-10-112-32/+27
| | | | | | tests_typestate attribute. Patch by chris.wailes@gmail.com. llvm-svn: 192513
* Improve the error message for attempting to build a for range loop using aRichard Trieu2013-10-111-2/+17
| | | | | | | | | function parameter that has array type. Such a parameter will be treated as a pointer type instead, resulting in a missing begin function error is a suggestion to dereference the pointer. This provides a different, more informative diagnostic as well as point to the parameter declaration. llvm-svn: 192512
* Adds Microsoft compatiable C++ record layout code to clang.Warren Hunt2013-10-112-2/+8
| | | | llvm-svn: 192494
* Diagnose by-copy captures of abstract classes.Douglas Gregor2013-10-111-0/+4
| | | | | | Fixes <rdar://problem/14468891>. llvm-svn: 192419
* ObjectiveC. ObjectiveC's collection selector expression inFariborz Jahanian2013-10-101-0/+3
| | | | | | | | the fereach loop must be a non-const lvalue expression as it will be assigned to at the beginning of the loop. // rdar://15123684 llvm-svn: 192399
* Sema: Taking the address of a dtor is illegal per C++ [class.dtor]p2.Benjamin Kramer2013-10-101-0/+4
| | | | | | Emit a proper error instead of crashing in CodeGen. PR16892. llvm-svn: 192345
* Refine string literal concatenation warning within an NSArray literal to not ↵Ted Kremenek2013-10-091-4/+18
| | | | | | warn when the literal comes from a macro expansion. Fixes <rdar://problem/15147688>. llvm-svn: 192328
* Consumed analysis: improve loop handling. The prior version of the analysisDeLesley Hutchins2013-10-091-0/+7
| | | | | | | | | | | | marked all variables as "unknown" at the start of a loop. The new version keeps the initial state of variables unchanged, but issues a warning if the state at the end of the loop is different from the state at the beginning. This patch will eventually be replaced with a more precise analysis. Initial patch by chris.wailes@gmail.com. Reviewed and edited by delesley@google.com. llvm-svn: 192314
* Tighten diagnostics for calling conventions on variadic functionsHans Wennborg2013-10-091-12/+16
| | | | | | | | | | | | Follow-up from r192240. This makes it an error to use callee-cleanup conventions on variadic functions, except for __fastcall and __stdcall, which we ignore with a warning for GCC and MSVC compatibility. Differential Revision: http://llvm-reviews.chandlerc.com/D1870 llvm-svn: 192308
* -Wmicrosoft: Don't warn on non-inline pure virtual method definitionsReid Kleckner2013-10-081-1/+1
| | | | | | | | | | | | | | | MSVC and clang with -fms-extensions allow pure virtual methods to be defined inline after the "= 0" tokens. Clang warns on these because it is not standard, but incorrectly warns on out-of-line definitions, which are standard. With this change, clang will only warn on inline definitions of pure virtual methods. Fixes some self-host warnings on out-of-line definitions of pure virtual destructors. llvm-svn: 192244
* Turn error about fastcall variadic function into warning in MS mode (PR12535)Hans Wennborg2013-10-081-1/+5
| | | | | | | | | | MSVC allows this and silently falls back to __cdecl for variadic functions. This patch turns Clang's error into a warning in MS mode and adds a test to make sure we generate correct code. Differential Revision: http://llvm-reviews.chandlerc.com/D1861 llvm-svn: 192240
* Remove transient code I did not mean to check in.Ted Kremenek2013-10-081-12/+0
| | | | llvm-svn: 192211
* Convert anachronistic use of 'void *' to 'DeclContext *' in Scope that was a ↵Ted Kremenek2013-10-089-35/+39
| | | | | | holdover from the long-dead Action interface. llvm-svn: 192203
* Make InstantiatingTemplate depth checks clearerAlp Toker2013-10-085-24/+23
| | | | | | | | | | The bool conversion operator on InstantiatingTemplate never added value and only served to obfuscate the template instantiation routines. This replaces the conversion and its callers with an explicit isInvalid() function to make it clear what's going on at a glance. llvm-svn: 192177
* [ms-cxxabi] Fix the calling convention for operator new in recordsReid Kleckner2013-10-083-12/+21
| | | | | | | | | | | | | | | | | | Summary: Operator new, new[], delete, and delete[] are all implicitly static when declared inside a record. CXXMethodDecl already knows this, but we need to account for that before we pick the calling convention for the function type. Fixes PR17371. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1761 llvm-svn: 192150
* Sema: Only merge typedef attributes if the previous decl is a typedefJustin Bogner2013-10-081-5/+5
| | | | | | | | | | | | In r186373, we started merging attributes on typedefs, but this causes us to try to merge attributes even if the previous declaration was not a typedef. Only merge the attributes if the previous decl was also a typedef. Fixes rdar://problem/15044218 llvm-svn: 192146
* Add support for WG21 N3599 (literal operator template for strings) as a GNURichard Smith2013-10-073-48/+135
| | | | | | | | | extension. The GCC folks have decided to support this even though the standard committee have not yet approved this feature. Patch by Hristo Venev! llvm-svn: 192128
* ObjectiveC: Warn when 'readonly' property has explicitFariborz Jahanian2013-10-071-118/+39
| | | | | | | ownership attribute (such as 'copy', 'assign' etc.) // rdar://15131088 llvm-svn: 192115
* Sema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, ↵NAKAMURA Takumi2013-10-071-4/+0
| | | | | | IsBlock, and IsLambda. [-Wunused-variable] llvm-svn: 192095
* Refactor tryCaptureVar using ExtractMethod. No functionality change.Faisal Vali2013-10-071-301/+394
| | | | | | | | | | In chicago, Doug had requested that I go ahead and commit the refactor as a separate change, if all the tests passed. Lets hope the buildbots stay quiet. Thanks! llvm-svn: 192087
* Switching the CallableWhen attribute over to using the string literal helper ↵Aaron Ballman2013-10-051-17/+11
| | | | | | function instead of custom logic. llvm-svn: 192050
* Silencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.Aaron Ballman2013-10-051-1/+1
| | | | llvm-svn: 192043
* Sema: Cleanup redundant variable NumArgsToCheckBenjamin Kramer2013-10-051-4/+1
| | | | | | Patch by Daniel Marjamäki! llvm-svn: 192030
* Consumed Analysis: Change callable_when so that it can take a list of statesDeLesley Hutchins2013-10-042-30/+42
| | | | | | | | that a function can be called in. This reduced the total number of annotations needed and makes writing more complicated behaviour less burdensome. Patch by chriswails@gmail.com. llvm-svn: 191983
* ObjectiveC. Allow readonly properties without an explicit ownershipFariborz Jahanian2013-10-041-24/+34
| | | | | | | | (assign/unsafe_unretained/weak/retain/strong/copy) in super class to be overridden by a property with any explicit ownership in the subclass. // rdar://15014468 llvm-svn: 191971
* Revert "Teach TreeTransform and family how to transform generic lambdas ↵Rafael Espindola2013-10-043-153/+28
| | | | | | | | within templates and nested within themselves." This reverts commit r191879. It caused llvm.org/pr17476. llvm-svn: 191955
* Gracefully (and correctly) handle init of multiple union membersMatthew Curtis2013-10-031-1/+22
| | | | | | | | | | | | | | | We now emit warnings when doing so and code generation is consistent with GCC. Note that the C99 spec is unclear as to the precise behavior. See also ... Bug: http://llvm.org/bugs/show_bug.cgi?id=16644 and cfe-dev discussion: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html llvm-svn: 191890
* Teach TreeTransform and family how to transform generic lambdas within ↵Faisal Vali2013-10-033-28/+153
| | | | | | | | | | | | | | | | | templates and nested within themselves. This does not yet include capturing (that is next). Please see test file for examples. This patch was LGTM'd by Doug: http://llvm-reviews.chandlerc.com/D1784 http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090048.html When I first committed this patch - a bunch of buildbots were unable to compile the code that VS2010 seemed to compile. Seems like there was a dependency on Sema/Template.h which VS did not seem to need, but I have now added for the other compilers. It still compiles on Visual Studio 2010 - lets hope the buildbots remain quiet (please!) llvm-svn: 191879
* Revert changes from the nested lambdas commit till i figure out Faisal Vali2013-10-033-152/+28
| | | | | | why the buildbots are failing. llvm-svn: 191876
* Teach TreeTransform and family how to transform generic lambdas within ↵Faisal Vali2013-10-033-28/+152
| | | | | | | | | | | | | | templates and nested within themselves. This does not yet include capturing (that is next). Please see test file for examples. This patch was LGTM'd by Doug: http://llvm-reviews.chandlerc.com/D1784 llvm-svn: 191875
* Speed up CorrectTypo by avoiding lookups on unreasonable candidates.Kaelyn Uhrain2013-10-021-37/+47
| | | | llvm-svn: 191846
* Fix gcc -Wunused-but-set-variable warning in r191634.Patrik Hagglund2013-10-021-5/+2
| | | | llvm-svn: 191817
* Implement ARM GNU-style interrupt attributeTim Northover2013-10-012-1/+48
| | | | | | | | | | This attribute allows users to use a modified C or C++ function as an ARM exception-handling function and, with care, to successfully return control to user-space after the issue has been dealt with. rdar://problem/14207019 llvm-svn: 191769
* Move checkStringLiteralArgument into Sema classTim Northover2013-10-011-16/+15
| | | | | | It's a useful function to have around for target-specific attributes. llvm-svn: 191768
* [OpenMP] Added parsing and semantic analysis for firstprivate clauseAlexey Bataev2013-10-012-16/+270
| | | | llvm-svn: 191730
* Fix typo correction usage of SemaAccess.cpp.Eli Friedman2013-10-012-6/+4
| | | | | | | | | | When we check access for lookup results, make sure we propagate the result's access to the access control APIs; this can be different from the natural access of the declaration depending on the path used by the lookup. PR17394. llvm-svn: 191726
* Tweak changes in r186464 to avoid a crash.Eli Friedman2013-10-011-1/+4
| | | | | | | | | | | | | Currently, IR generation can't handle file-scope compound literals with non-constant initializers in C++. Fixes PR17415 (the first crash in the bug). (We should probably change (T){1,2,3} to use the same codepath as T{1,2,3} in C++ eventually, given that the semantics of the latter are actually defined by the standard.) llvm-svn: 191719
* Remove support for arrays of runtime bound in C++1y, now they have been votedRichard Smith2013-10-012-6/+1
| | | | | | out of the working paper. This reverts r179962 and r179992. llvm-svn: 191718
* Fix use-after-free.Manuel Klimek2013-09-301-3/+3
| | | | | | | | TemplateDeclInstantiator takes the MultiLevelArgumentList by const-ref and stores a const-ref member. Thus, we must not pass a temporary into the constructor. llvm-svn: 191665
OpenPOWER on IntegriCloud