summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* PR15100: look through type sugar when determining whether we have one of theRichard Smith2013-01-291-1/+2
| | | | | | forms of 'main' which we accept as an extension. llvm-svn: 173758
* Actually remove the hack which was blocking the Borland-style attributes fromRichard Smith2013-01-291-7/+0
| | | | | | | working, and add the missing attribute spellings. This brings _pascal, _fastcall, _stdcall and _cdecl to life in -fborland-extensions mode. llvm-svn: 173749
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-292-12/+5
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Finish semantic analysis for [[carries_dependency]] attribute.Richard Smith2013-01-282-8/+56
| | | | | | | | | | This required plumbing through a new flag to determine whether a ParmVarDecl is actually a parameter of a function declaration (as opposed to a function typedef etc, where the attribute is prohibited). Weirdly, this attribute (just like [[noreturn]]) cannot be applied to a function type, just to a function declaration (and its parameters). llvm-svn: 173726
* Undo my re-wording of the "ARC forbids Objective-C objects in ..."Douglas Gregor2013-01-281-1/+1
| | | | | | error. Jordan is right. llvm-svn: 173713
* Forbid the use of objects in unions in Objective-C++ ARC. FixesDouglas Gregor2013-01-281-32/+30
| | | | | | <rdar://problem/13098104>. llvm-svn: 173708
* Tests and a minor bugfix for [dcl.attr.depend]p1 (C++11 [[carries_dependency]]Richard Smith2013-01-281-1/+1
| | | | | | attribute). llvm-svn: 173645
* Add a -pedantic warning: an anonymous union within an anonymous union is notRichard Smith2013-01-281-0/+6
| | | | | | | permitted in standard C++, despite being silently accepted by many (all?) major C++ implementations. llvm-svn: 173643
* Fix mismatch between pointer and pointee type when diagnosing an incorrectRichard Smith2013-01-261-3/+2
| | | | | | object argument type for a member call. llvm-svn: 173554
* Remove function that is newly dead as of r173538.Nick Lewycky2013-01-261-4/+0
| | | | llvm-svn: 173550
* Revert r172285 (suppressing a 'redundant' -Wc++98-compat warning) and add aRichard Smith2013-01-261-1/+0
| | | | | | testcase for a situation it caused us to miss. llvm-svn: 173540
* Preserve Sema::UndefinedInternals across PCH boundaries. FixesNick Lewycky2013-01-263-17/+15
| | | | | | -Wundefined-internal warnings with PCH. llvm-svn: 173538
* patch for PR9027 and // rdar://11861085Fariborz Jahanian2013-01-251-0/+4
| | | | | | | | | | | Title: [PR9027] volatile struct bug: member is not loaded at -O; This is caused by last flag passed to @llvm.memcpy being false, not honoring that aggregate has at least one 'volatile' data member (even though aggregate itself has not been qualified as 'volatile'. As a result, optimization optimizes away the memcpy altogether. Patch review by John MaCall (I still need to fix up a test though). llvm-svn: 173535
* The standard ARM C++ ABI dictates that inline functions areJohn McCall2013-01-253-4/+26
| | | | | | | | never key functions. We did not implement that rule for the iOS ABI, which was driven by what was implemented in gcc-4.2. However, implement it now for other ARM-based platforms. llvm-svn: 173515
* First pass at abstracting out a class for the target C++ ABI.John McCall2013-01-251-5/+10
| | | | llvm-svn: 173514
* Silence unintended fallthrough diagnostic on a case label preceded with a ↵Alexander Kornienko2013-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | normal label. Summary: It's unlikely that a fallthrough is unintended in the following code: switch (n) { ... label: case 1: ... goto label; ... } Reviewers: rsmith, doug.gregor Reviewed By: doug.gregor CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D329 llvm-svn: 173486
* Don't suggest to insert [[clang::fallthrough]] before empty cases. Fix for ↵Alexander Kornienko2013-01-251-5/+10
| | | | | | multiple case labels. llvm-svn: 173458
* Sync 'in class initialization of static const double' extension up with GCC,Richard Smith2013-01-251-8/+14
| | | | | | | | | | | | | and split it out of -Wgnu into its own warning flag. * In C++11, this is now a hard error (GCC has no extension here in C++11 mode). The error can be disabled with -Wno-static-float-init, and has a fixit to add 'constexpr'. * In C++98, this is still an ExtWarn, but is now controlled by -Wstatic-float-init as well as -Wgnu. llvm-svn: 173414
* Clean up: since we have FunctionDecl::IsInline, make it store the right valueRichard Smith2013-01-251-0/+9
| | | | | | | | | | | | for template instantiations, and use it to simplify the implementation of FunctionDecl::isInlined(). This incidentally changes the result of isInlined on a declared-but-not-defined non-inline member function from true to false. This is sort of a bug fix, but currently isInlined is only called on function definitions, so it has no visible effects. llvm-svn: 173397
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-244-12/+29
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* [ms-inline asm] Add an error when trying to compile MS-style inline assemblyChad Rosier2013-01-241-2/+9
| | | | | | | for an unsupported architecture. rdar://13063988 llvm-svn: 173364
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-245-207/+414
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Start checking nonnull (as well as format and argument_with_type_tag) onNick Lewycky2013-01-241-0/+7
| | | | | | overloaded binary operators. llvm-svn: 173315
* Fix some wonky formatting, remove spurious emacs major mode marker. NoNick Lewycky2013-01-242-10/+8
| | | | | | functionality change! llvm-svn: 173314
* Micro cleanup: use an array of const char, rather than an array of char, as theRichard Smith2013-01-231-1/+1
| | | | | | | type of the string literal implicitly used for a raw user-defined literal call. No test; this has no semantic impact. llvm-svn: 173309
* Implement -Wvla correctlyDmitri Gribenko2013-01-231-0/+5
| | | | | | | | | | | | | GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA, for example, if they are forbidden by coding guidelines). Currently Clang implements -Wvla as "warn on VLA when it is an extension". The attached patch makes our behavior match GCC. The existing vla extwarn is moved under -Wvla-extension and is still included into -Wgnu. This fixes PR5953. llvm-svn: 173286
OpenPOWER on IntegriCloud