summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Retain all hidden methods in the global method pool, because they may become ↵Douglas Gregor2013-02-071-0/+4
| | | | | | visible <rdar://problem/13172858>. llvm-svn: 174648
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-072-0/+12
| | | | | | OpenCL builtin functions. llvm-svn: 174630
* Add OpenCL samplers as Clang builtin types and check sampler related ↵Guy Benyei2013-02-076-2/+63
| | | | | | restrictions. llvm-svn: 174601
* Apply the pure-virtual odr rule to other constructs which can call overloadedNick Lewycky2013-02-071-25/+14
| | | | | | operators. llvm-svn: 174584
* Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith2013-02-071-12/+5
| | | | | | | | | | | | if it found any decls, rather than returning a list of found decls. This removes a returning-ArrayRef-to-deleted-storage bug from MultiplexExternalSemaSource (in code not exercised by any of the clang binaries), reduces the work required in the found-no-decls case with PCH, and importantly removes the need for DeclContext::lookup to be reentrant. No functionality change intended! llvm-svn: 174576
* -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in ↵Alexander Kornienko2013-02-071-3/+16
| | | | | | | | | | | | | | | | | | | | | | unreachable code" was issued incorrectly. Summary: -Wimplicit-fallthrough: fixed two cases where "fallthrough annotation in unreachable code" was issued incorrectly: 1. In actual unreachable code, but not immediately on a fall-through execution path "fallthrough annotation does not directly precede switch label" is better; 2. After default: in a switch with covered enum cases. Actually, these shouldn't be treated as unreachable code for our purpose. Reviewers: rsmith Reviewed By: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D374 llvm-svn: 174575
* Don't check whether a friend declaration is correctly formed when instantiating,Nick Lewycky2013-02-061-33/+35
| | | | | | we already checked it when parsing. llvm-svn: 174486
* Use a dyn_cast to avoid a crash when the TypeLoc is not a ConstantArrayTypeLoc.Chad Rosier2013-02-061-4/+5
| | | | | | rdar://13153516 llvm-svn: 174477
* Test for virtual instead of pure here. It has the exact same effect, and JohnNick Lewycky2013-02-051-1/+1
| | | | | | claims it will improve performance. llvm-svn: 174341
* PR15095: Use more correct source locations for the InitListExpr we fake up forRichard Smith2013-02-051-3/+8
| | | | | | vector initialization. Patch by John Stratton! llvm-svn: 174339
* Add some missing diagnostics for C++11 narrowing conversions.Richard Smith2013-02-053-8/+16
| | | | llvm-svn: 174337
* PR15132: Replace "address expression must be an lvalue or a functionRichard Smith2013-02-021-6/+7
| | | | | | | | | | | | | | designator" diagnostic with more correct and more human-friendly "cannot take address of rvalue of type 'T'". For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully saying "cannot take address of rvalue of type '<overloaded function type>'". For the case of &array_temporary, treat it just like a class temporary (including allowing it as an extension); the existing diagnostic wording for the class temporary case works fine. llvm-svn: 174262
* Don't forget to run destructors when we create an array temporary of class type.Richard Smith2013-02-021-2/+5
| | | | llvm-svn: 174257
* This patch makes "&Cls::purevfn" not an odr use. This isn't what the standardNick Lewycky2013-02-023-17/+30
| | | | | | | | | says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use. Also fixes a bug that caused us to not mark the function referenced just because we didn't want to mark it odr used. llvm-svn: 174242
* objc: Provide correct fixit instruction when two mismatchedFariborz Jahanian2013-02-011-2/+3
| | | | | | nsstringis are compared without. // rdar://12716301 llvm-svn: 174214
* For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis2013-02-011-1/+1
| | | | | | module import occurred. llvm-svn: 174191
* Fixed segmentation fault when a CFGBlock has NULL successor.Alexander Kornienko2013-02-011-1/+1
| | | | llvm-svn: 174182
* Fix PR14881 by implementing conversion rules between int and complex int.Bill Schmidt2013-02-011-54/+68
| | | | | | | | | | | | | | Prior to the patch, Clang does not properly promote types when a complex integer operand is combined with an integer via a binary operator, or when one is assigned to the other in either order. This patch detects when promotion is needed (and permissible) and generates the necessary code. The test assmes no target has the same size operands for "char" and "long long," and that no target performs arithmetic on char operands without extending them to a larger format first. If there are any targets for which this is not the case, they should be XFAILed. llvm-svn: 174181
* Fix diagnostic for bad alignas use: it can't be applied to functions.Richard Smith2013-02-011-2/+5
| | | | llvm-svn: 174160
* Add a new -Wundefined-inline warning for inline functions which are used but notNick Lewycky2013-02-014-31/+71
| | | | | | defined. Fixes PR14993! llvm-svn: 174158
* Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.Richard Smith2013-02-013-38/+99
| | | | | | Also support alignas(0), which C++11 and C11 require us to ignore. llvm-svn: 174157
* Don't do delayed exception-specification checking on an invalidDouglas Gregor2013-02-011-0/+8
| | | | | | class. Fixes <rdar://problem/13017229>. llvm-svn: 174145
* [Sema][Attr]Fix alignment attribute printing.Michael Han2013-02-012-21/+21
| | | | | | | | | Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should only model those appear in source code. Introduce attribute Accessor, and teach TableGen to generate syntax kind accessors for Align attribute, and use those accessors to decide if an alignment attribute is a declspec attribute. llvm-svn: 174133
* Added outer template parameter lists to friend type AST nodes.Enea Zaffanella2013-01-311-3/+4
| | | | llvm-svn: 174050
* Improve 'failed template argument deduction' diagnostic for the case where weRichard Smith2013-01-312-39/+71
| | | | | | | | have a direct mismatch between some component of the template and some component of the argument. The diagnostic now says what the mismatch was, but doesn't yet say which part of the template doesn't match. llvm-svn: 174039
* When code completing in a statement, parenthesized expression, orDouglas Gregor2013-01-311-1/+9
| | | | | | | | Objective-C message receiver, the user is as likely to want to write a type name as any other declaration, so give types the same priority as other declarations. Fixes <rdar://problem/12480600>. llvm-svn: 174038
* Allow the computation of the base priority for a declaration code completion ↵Douglas Gregor2013-01-312-47/+65
| | | | | | result to consider the completion context llvm-svn: 174037
* Replace "failed template argument deduction" diagnostic with something usefulRichard Smith2013-01-312-7/+30
| | | | | | in the one case where we've already factored out a reason code. llvm-svn: 174036
* Remove elements from Sema.UndefinedInternals as functions are defined. AlsoNick Lewycky2013-01-313-27/+58
| | | | | | | filter the elements before emitting them into a PCH. No user-visible functionality change, except that PCH files may be smaller? llvm-svn: 174034
* Fix grammar in comment.Nick Lewycky2013-01-311-1/+1
| | | | llvm-svn: 174033
* Clarify the diagnostic for -Wnested-anon-types.Richard Smith2013-01-311-1/+2
| | | | llvm-svn: 174032
* Fix ODR-use of a MemberExpr to check before marking a pure function used. RemoveNick Lewycky2013-01-312-3/+13
| | | | | | a workaround for this bug from the -Wundefined-internals warning. llvm-svn: 174020
* Fix unused variable warnings in -asserts buildMatt Beaumont-Gay2013-01-311-2/+2
| | | | llvm-svn: 173996
* Add OpenCL error that a kernel function must have void return type. Includes ↵Tanya Lattner2013-01-301-1/+8
| | | | | | a test case. llvm-svn: 173963
* Hoist retrieval of Expr* into caller. No functionality change.Ted Kremenek2013-01-301-6/+6
| | | | | | Just makes the code a little cleaner, and easier to reason about. llvm-svn: 173953
* Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2013-01-301-1/+1
| | | | | | This is required to use them in TableGen. llvm-svn: 173924
* Also promote fp16 types to double when they're anonymous variadic arguments.Tim Northover2013-01-301-4/+8
| | | | | | | | __fp16 isn't covered by the standard, but this resolves the oddity that float gets promoted when passed variadically, but not the smaller type. This is required by the AArch64 ABI, and a sane action elsewhere. llvm-svn: 173918
* Add "instancetype" as a code completion result for the return type ofDouglas Gregor2013-01-301-0/+5
| | | | | | an Objective-C method. Fixes <rdar://problem/13069990>. llvm-svn: 173905
* The instance methods of the root class of an Objective-C hieararchyDouglas Gregor2013-01-301-2/+6
| | | | | | | can be messaged via the metaclass. Provide code completions for this case. Fixes <rdar://problem/12560296>. llvm-svn: 173903
* Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled asRichard Smith2013-01-301-0/+10
| | | | | | an attribute for consistency with our other noreturn mechanisms. llvm-svn: 173898
* Don't warn on fall-through from unreachable code.Alexander Kornienko2013-01-301-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A motivating example: class ClassWithDtor { public: ~ClassWithDtor() {} }; void fallthrough3(int n) { switch (n) { case 2: do { ClassWithDtor temp; return; } while (0); // This generates a chain of unreachable CFG blocks. case 3: break; } } Reviewers: rsmith, doug.gregor, alexfh Reviewed By: alexfh CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D330 llvm-svn: 173889
* Provide a fixit for constexpr non-static data members.David Blaikie2013-01-302-4/+30
| | | | | | | | | | | | | | | | If the member has an initializer, assume it was probably intended to be static and suggest/recover with that. If the member doesn't have an initializer, assume it was probably intended to be const instead of constexpr and suggest that. (if the attempt to apply these changes fails, don't make any suggestion & produce the same diagnostic experience as before. The only case where this can come up that I know of is with a mutable constexpr with an initializer, since mutable is incompatible with static (but it's already incompatible with const anyway)) llvm-svn: 173873
* c: When checking on validity of sizeof passed as size ofFariborz Jahanian2013-01-301-1/+2
| | | | | | | | argument to be memset, check for its type to be complete before calling Context.getTypeSize(PointeeTy) to prevent crash. // rdar://13081751. llvm-svn: 173872
* Move -Wstatic-float-init fixit into a note & don't recover as if constexprDavid Blaikie2013-01-291-9/+6
| | | | llvm-svn: 173841
* Don't fixit/recover from -Wstatic-float-init when it's not an error.David Blaikie2013-01-291-5/+9
| | | | | | | Fix to change r173414 that lead to Clang changing const to constexpr even under -Wno-static-float-init. llvm-svn: 173835
* Mark a struct definition in an objc container with the ↵Argyrios Kyrtzidis2013-01-291-1/+5
| | | | | | | | | | | TopLevelDeclInObjCContainer bit. Fixes accurately getting a cursor inside an objc container containing a struct definition, from a PCH/preamble file. rdar://12584613 llvm-svn: 173811
* Add a diagnostic for an OpenCL kernel with a pointer pointer argument.Joey Gouly2013-01-291-7/+16
| | | | | | Also refactor the surrounding code a little. llvm-svn: 173791
* Downgrade 'attribute ignored when parsing type' from error to warning, to matchRichard Smith2013-01-292-3/+13
| | | | | | | | | the diagnostic's warn_ name. Switch some places (notably C++11 attributes) which really wanted an error over to a different diagnostic. Finally, suppress the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing diagnostics in important system headers. llvm-svn: 173788
* Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.Richard Smith2013-01-291-3/+41
| | | | llvm-svn: 173779
* Propagate the spelling list index for an attribute across template ↵Richard Smith2013-01-292-5/+7
| | | | | | instantiation. llvm-svn: 173768
OpenPOWER on IntegriCloud