summaryrefslogtreecommitdiffstats
path: root/include/clang/Basic/DiagnosticSemaKinds.td
Commit message (Collapse)AuthorAgeFilesLines
* Merging r313675:Tom Stellard2017-11-131-1/+1
| | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r313675 | rcraik | 2017-09-19 14:04:23 -0700 (Tue, 19 Sep 2017) | 9 lines [OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) values When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec): 1) The iteration vector vec contains less than n items 2) The iteration vector vec contains a variable that is not a loop control variable This patch addresses both of these issues. Differential Revision: https://reviews.llvm.org/D38049 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@318116 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r310804:Hans Wennborg2017-08-141-20/+20
| | | | | | | | | | | | ------------------------------------------------------------------------ r310804 | rsmith | 2017-08-13 15:26:53 -0700 (Sun, 13 Aug 2017) | 2 lines Replace remaining user-visible mentions of C++1z with C++17. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@310862 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r308455:Hans Wennborg2017-07-191-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r308455 | hans | 2017-07-19 05:31:01 -0700 (Wed, 19 Jul 2017) | 16 lines Revert r308441 "Recommit r308327: Add a warning for missing '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files" This seems to have broken the sanitizer-x86_64-linux buildbot. Reverting until it's fixed, especially since this landed just before the 5.0 branch. > This commit adds a new -Wpragma-pack warning. It warns in the following cases: > > - When a translation unit is missing terminating #pragma pack (pop) directives. > - When entering an included file if the current alignment value as determined > by '#pragma pack' directives is different from the default alignment value. > - When leaving an included file that changed the state of the current alignment > value. > > rdar://10184173 > > Differential Revision: https://reviews.llvm.org/D35484 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_50@308457 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r308327: Add a warning for missing '#pragma pack (pop)'Alex Lorenz2017-07-191-0/+10
| | | | | | | | | | | | | | | | | | | and suspicious uses of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308441 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Initial support for 'task_reduction' clause.Alexey Bataev2017-07-181-3/+3
| | | | | | Parsing/sema analysis of the 'task_reduction' clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308352 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r308327Alex Lorenz2017-07-181-10/+0
| | | | | | | I forgot to test clang-tools-extra which is now failing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308328 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a warning for missing '#pragma pack (pop)' and suspicious usesAlex Lorenz2017-07-181-0/+10
| | | | | | | | | | | | | | | | | | | of '#pragma pack' in included files This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308327 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add support for __builtin_ms_va_list on aarch64Martin Storsjo2017-07-171-2/+2
| | | | | | | | | | | Move builtins from the x86 specific scope into the global scope. Their use is still limited to x86_64 and aarch64 though. This allows wine on aarch64 to properly handle variadic functions. Differential Revision: https://reviews.llvm.org/D34475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308218 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend -Wdeprecated-implementations to warn about unavailable methodsAlex Lorenz2017-07-131-0/+3
| | | | | | | rdar://22867595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307924 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC, Cleanup the code for -Wdeprecated-implementationsAlex Lorenz2017-07-131-2/+2
| | | | | | | | | and void capitalization of the warning message rdar://22867595 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307923 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC] Pick a 'readwrite' property when synthesizing ambiguousAlex Lorenz2017-07-131-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | property and check for incompatible attributes This commit changes the way ambiguous property synthesis (i.e. when synthesizing a property that's declared in multiple protocols) is performed. Previously, Clang synthesized the first property that was found. This lead to problems when the property was synthesized in a class that conformed to two protocols that declared that property and a second protocols had a 'readwrite' declaration - the setter was not synthesized so the class didn't really conform to the second protocol and user's code would crash at runtime when they would try to set the property. This commit ensures that a first readwrite property is selected. This is a semantic change that changes users code in this manner: ``` @protocol P @property(readonly) int p; @end @protocol P2 @property(readwrite) id p; @end @interface I <P2> @end @implementation I @syntesize p; // Users previously got a warning here, and Clang synthesized // readonly 'int p' here. Now Clang synthesizes readwrite 'id' p.. @end ``` To ensure that this change is safe, the warning about incompatible types is promoted to an error when this kind of readonly/readwrite ambiguity is detected in the @implementation. This will ensure that previous code that had this subtle bug and ignored the warning now will fail to compile with an error, and users should not get suprises at runtime once they resolve the error. The commit also extends the ambiguity checker, and now it can detect conflicts among the different property attributes. An error diagnostic is used for conflicting attributes, to ensure that the user won't get "suprises" at runtime. ProtocolPropertyMap is removed in favour of a a set + vector because the map's order of iteration is non-deterministic, so it couldn't be used to select the readwrite property. rdar://31579994 Differential Revision: https://reviews.llvm.org/D35268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307903 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Add restriction for reduction clause in taskloop directives.Alexey Bataev2017-07-111-0/+4
| | | | | | | | Added checks for the reduction clauses in the taskloop directives: 1. Only addressable items must be used in reduction clauses. 2. Reduction clauses cannot be used with nogroup clauses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307693 91177308-0d34-0410-b5e6-96231b3b80d8
* Customize the SFINAE diagnostics for enable_if to provide the failed condition.Douglas Gregor2017-07-051-0/+5
| | | | | | | | | | | | | | | | | | | | When enable_if disables a particular overload resolution candidate, rummage through the enable_if condition to find the specific condition that caused the failure. For example, if we have something like: template< typename Iter, typename = std::enable_if_t<Random_access_iterator<Iter> && Comparable<Iterator_value_type<Iter>>>> void mysort(Iter first, Iter last) {} and we call "mysort" with "std::list<int>" iterators, we'll get a diagnostic saying that the "Random_access_iterator<Iter>" requirement failed. If we call "mysort" with "std::vector<something_not_comparable>", we'll get a diagnostic saying that the "Comparable<...>" requirement failed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307196 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Don't allow -Wunguarded-availability to be silenced with redeclsErik Pilkington2017-07-051-1/+1
| | | | | | Differential revision: https://reviews.llvm.org/D33816 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307175 91177308-0d34-0410-b5e6-96231b3b80d8
* Address comments that escaped D33333Erich Keane2017-07-051-9/+7
| | | | | | | | | Patch By: Jen Yu Differential Revision:https://reviews.llvm.org/D34671 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307172 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Rename err_opencl_enqueue_kernel_expected_typeJoey Gouly2017-07-041-2/+3
| | | | | | | | | | Rename err_opencl_enqueue_kernel_expected_type so that other builtins can use the same diagnostic. https://reviews.llvm.org/D34948 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307067 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a fixit for -Wobjc-protocol-property-synthesisAlex Lorenz2017-07-031-0/+2
| | | | | | | | | rdar://32132756 Differential Revision: https://reviews.llvm.org/D34886 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307014 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Add function name to extension diagnosticJoey Gouly2017-06-301-1/+1
| | | | | | | Slightly improve the diagnostic by including the function name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306827 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Issue diagnostics if a new/delete expression generates a call toAkira Hatanaka2017-06-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | a c++17 aligned allocation/deallocation function that is unavailable in the standard library on Apple platforms. The aligned functions are implemented only in the following versions or later versions of the OSes, so clang issues diagnostics if the deployment target being targeted is older than these: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 The diagnostics are issued whenever the aligned functions are selected except when the selected function has a definition in the same file. If there is a user-defined function available somewhere else, option -Wno-aligned-allocation-unavailable can be used to silence the diagnostics. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34574 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306722 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Allow unmarked overloadable functions.George Burgess IV2017-06-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the `overloadable` attribute to allow for one function with a given name to not be marked with the `overloadable` attribute. The overload without the `overloadable` attribute will not have its name mangled. So, the following code is now legal: void foo(void) __attribute__((overloadable)); void foo(int); void foo(float) __attribute__((overloadable)); In addition, this patch fixes a bug where we'd accept code with `__attribute__((overloadable))` inconsistently applied. In other words, we used to accept: void foo(void); void foo(void) __attribute__((overloadable)); But we will do this no longer, since it defeats the original purpose of requiring `__attribute__((overloadable))` on all redeclarations of a function. This breakage seems to not be an issue in practice, since the only code I could find that had this pattern often looked like: void foo(void); void foo(void) __attribute__((overloadable)) __asm__("foo"); void foo(int) __attribute__((overloadable)); ...Which can now be simplified by simply removing the asm label and overloadable attribute from the redeclaration of `void foo(void);` Differential Revision: https://reviews.llvm.org/D32332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306467 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit warning when throw exception in destruct or dealloc functions which has a Erich Keane2017-06-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (possible implicit) noexcept specifier Throwing in the destructor is not good (C++11 change try to not allow see below). But in reality, those codes are exist. C++11 [class.dtor]p3: A declaration of a destructor that does not have an exception-specification is implicitly considered to have the same exception specification as an implicit declaration. With this change, the application worked before may now run into runtime termination. My goal here is to emit a warning to provide only possible info to where the code may need to be changed. First there is no way, in compile time to identify the “throw” really throw out of the function. Things like the call which throw out… To keep this simple, when “throw” is seen, checking its enclosing function(only destructor and dealloc functions) with noexcept(true) specifier emit warning. Here is implementation detail: A new member function CheckCXXThrowInNonThrowingFunc is added for class Sema in Sema.h. It is used in the call to both BuildCXXThrow and TransformCXXThrowExpr. The function basic check if the enclosing function with non-throwing noexcept specifer, if so emit warning for it. The example of warning message like: k1.cpp:18:3: warning: ''~dependent_warn'' has a (possible implicit) non-throwing noexcept specifier. Throwing exception may cause termination. [-Wthrow-in-dtor] throw 1; ^ k1.cpp:43:30: note: in instantiation of member function 'dependent_warn<noexcept_fun>::~dependent_warn' requested here dependent_warn<noexcept_fun> f; // cause warning Differential Revision: https://reviews.llvm.org/D33333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306149 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Add -Wunguarded-availability-newAlex Lorenz2017-06-221-0/+10
| | | | | | | | | | | | | | | | The new compiler warning -Wunguarded-availability-new is a subset of -Wunguarded-availability. It is on by default. It only warns about uses of APIs that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and tvOS >= 11. We decided to use this kind of solution as we didn't want to turn on -Wunguarded-availability by default, because we didn't want our users to get warnings about uses of old APIs in their existing projects. rdar://31054725 Differential Revision: https://reviews.llvm.org/D34264 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306033 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Diagnose scoped address-space qualified variablesAnastasia Stulova2017-06-201-0/+3
| | | | | | | | | | | | | | Produce an error if variables qualified with a local or a constant address space are not declared in the outermost scope of a kernel. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D34024 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305798 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a subgroup of c++1z-compat to enable and disable the warning aboutAkira Hatanaka2017-06-201-1/+1
| | | | | | | | | | c++17's non-throwing exception specification in function signature. rdar://problem/32628743 Differential Revision: https://reviews.llvm.org/D34251 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305772 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple of class template argument deduction crashes with libc++'s tuple.Richard Smith2017-06-071-0/+5
| | | | | | | | | | | | | | | | | RecursiveASTVisitor was not properly recursing through a SubstTemplateTypeParmTypes, resulting in crashes in pack expansion where we couldn't always find an unexpanded pack within a pack expansion. We also have an issue where substitution of deduced template arguments for an implicit deduction guide creates the "impossible" case of naming a non-dependent member of the current instantiation, but within a specialization that is actually instantiated from a different (partial/explicit) specialization of the template. We resolve this by declaring that constructors that do so can only be used to deduce specializations of the primary template. I'm running this past CWG to see if people agree this is the right thing to do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304862 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Harden function pointer diagnostics.Alexey Bader2017-06-021-1/+1
| | | | | | | | | | | | | | | | Summary: Improve OpenCL type checking by rejecting function pointer types. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33821 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304575 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Improve -Wstrict-prototypes diagnostic message for blocks.Akira Hatanaka2017-06-021-1/+1
| | | | | | | | | | | Print "this block declaration is not a prototype" for non-prototype declarations of blocks instead of "this function declaration ...". rdar://problem/32461723 Differential Revision: https://reviews.llvm.org/D33739 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304507 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Fix checking for prvalue-ness of `await_suspend` return typeEric Fiselier2017-05-311-2/+2
| | | | | | | | | | | | | | | | | Summary: @rsmith Does this correctly address the issues mentioned in https://reviews.llvm.org/D33625#inline-292971 ? Reviewers: rsmith, EricWF Reviewed By: EricWF Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D33636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304373 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.Alexey Bataev2017-05-301-2/+2
| | | | | | | | According to OpenMP 5.0 at least one 'map' or 'use_device_ptr' clause must be specified for 'target data' construct. Patch adds support for this feature. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304216 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Added diagnostic for implicit declaration of function in OpenCLEgor Churaev2017-05-301-0/+2
| | | | | | | | | | | | Reviewers: Anastasia, cfe-commits Reviewed By: Anastasia Subscribers: bader, yaxunl Differential Revision: https://reviews.llvm.org/D31745 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304193 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] An error shall occur if any scalar operand has greater rank than ↵Egor Churaev2017-05-301-0/+3
| | | | | | | | | | | | | | | | | | | | the type of the vector element Summary: This is the fix for patch https://reviews.llvm.org/D33353 @uweigand, could you please verify that everything will be good on SystemZ? I added triple spir-unknown-unknown. Thank you in advance! Reviewers: uweigand Reviewed By: uweigand Subscribers: yaxunl, cfe-commits, bader, Anastasia, uweigand Differential Revision: https://reviews.llvm.org/D33648 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304191 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Diagnose invalid result types for `await_resume` and ↵Eric Fiselier2017-05-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | `await_suspend` and add missing conversions. Summary: The expression `await_ready` is required to be contextually convertible to bool and `await_suspend` must be a prvalue of either `void` or `bool`. This patch adds diagnostics for when those requirements are violated. It also correctly performs the contextual conversion to bool on the result of `await_ready` Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33625 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304094 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused diagnostics. NFC.Benjamin Kramer2017-05-261-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304030 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[OpenCL] An error shall occur if any scalar operand has greater rank ↵Renato Golin2017-05-261-3/+0
| | | | | | | | | | | | | than the type of the vector element" This reverts commit r303986 as it broke all ARM and AArch64 buildbots... http://lab.llvm.org:8011/builders/clang-cmake-aarch64-39vma/builds/7007 http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/6705 http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15/builds/7509 etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303996 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] An error shall occur if any scalar operand has greater rank than ↵Egor Churaev2017-05-261-0/+3
| | | | | | | | | | | | | | the type of the vector element Reviewers: Anastasia Reviewed By: Anastasia Subscribers: cfe-commits, bader, yaxunl Differential Revision: https://reviews.llvm.org/D33353 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303986 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch from using a DiagnosticTrap and a note for "while defining a specialRichard Smith2017-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | member function" context notes to registering an entry on the context stack. Also reorder the steps within defining special members to be consistent. This has a few benefits: if multiple diagnostics are produced while checking such a member, the note is now attached to the first such diagnostic rather than the last, this prepares us for persisting these diagnostics between the point at which we require the implicit instantiation of a template and the point at which that instantiation is actually performed, and this fixes some cases where we would fail to produce a full note stack leading back to user code in the case of such a diagnostic. The reordering exposed a case where we could recursively attempt to define a defaulted destructor while we're already defining one (and other such cases also appear to be possible, with or without this change), so this change also reuses the "willHaveBody" flag on function declarations to track that we're in the middle of synthesizing a body for the function and bails out if we try to define a function that we're already defining. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303930 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Diagnose when promise types fail to declare either return_void ↵Eric Fiselier2017-05-251-4/+6
| | | | | | | | | | | | | | | | | | | or return_value. Summary: According to the PDTS it's perfectly legal to have a promise type that defines neither `return_value` nor `return_void`. However a coroutine that uses such a promise type will almost always have UB, because it can never `co_return`. This patch changes Clang to diagnose such cases as an error. It also cleans up some of the diagnostic messages relating to member lookup in the promise type. Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33534 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303868 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Fix fallthrough diagnostics for coroutinesEric Fiselier2017-05-251-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a number of issues with the analysis warnings emitted when a coroutine may reach the end of the function w/o returning. * Fix bug where coroutines with `return_value` are incorrectly diagnosed as missing `co_return`'s. * Rework diagnostic message to no longer say "non-void coroutine", because that implies the coroutine doesn't have a void return type, which it might. In this case a non-void coroutine is one who's promise type does not contain `return_void()` As a side-effect of this patch, coroutine bodies that contain an invalid coroutine promise objects are marked as invalid. Reviewers: GorNishanov, rsmith, aaron.ballman, majnemer Reviewed By: GorNishanov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D33532 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303831 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Sema: allow imaginary constants via GNU extension if UDL overloads ↵Tim Northover2017-05-241-2/+0
| | | | | | | | | not present." This reverts commit r303697. It broke libc++ tests that were specifically checking incompatibility in C++14 mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303813 91177308-0d34-0410-b5e6-96231b3b80d8
* Address follow-up feedback for r303712Argyrios Kyrtzidis2017-05-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303789 91177308-0d34-0410-b5e6-96231b3b80d8
* Warn about uses of `@available` that can't suppress theAlex Lorenz2017-05-241-0/+4
| | | | | | | | | | | -Wunguarded-availability warnings rdar://32306520 Differential Revision: https://reviews.llvm.org/D33450 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303761 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Implement vec_xxpermdi builtin.Tony Jiang2017-05-241-0/+3
| | | | | | | | | | The vec_xxpermdi builtin is missing from altivec.h. This has been requested by developers working on libvpx for VP9 support for Google. The patch fixes PR: https://bugs.llvm.org/show_bug.cgi?id=32653 Differential Revision: https://reviews.llvm.org/D33053 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303760 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize two diagnostic messages to take function name as parameter.Tony Jiang2017-05-241-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303753 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance the 'diagnose_if' attribute so that we can apply it for ObjC methods ↵Argyrios Kyrtzidis2017-05-241-0/+1
| | | | | | | | and properties as well This is an initial commit to allow using it with constant expressions, a follow-up commit will enable full support for it in ObjC methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303712 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema: allow imaginary constants via GNU extension if UDL overloads not present.Tim Northover2017-05-231-0/+2
| | | | | | | | | | | | | C++14 added user-defined literal support for complex numbers so that you can write something like "complex<double> val = 2i". However, there is an existing GNU extension supporting this syntax and interpreting the result as a _Complex type. This changes parsing so that such literals are interpreted in terms of C++14's operators if an overload is present but otherwise falls back to the original GNU extension. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303694 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Wrap the body of the coroutine in try-catchGor Nishanov2017-05-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: If unhandled_exception member function is present in the coroutine promise, wrap the body of the coroutine in: ``` try { body } catch(...) { promise.unhandled_exception(); } ``` Reviewers: EricWF, rnk, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31692 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303583 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Build GRO declaration and return GRO statementGor Nishanov2017-05-221-0/+2
| | | | | | | | | | | | | | | | | | Summary: 1. build declaration of the gro local variable that keeps the result of get_return_object. 2. build return statement returning the gro variable 3. emit them during CodeGen 4. sema and CodeGen tests updated Reviewers: EricWF, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31646 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303573 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Cast alloca to expected address spaceYaxun Liu2017-05-181-1/+1
| | | | | | | | | | | | Alloca always returns a pointer in alloca address space, which may be different from the type defined by the language. For example, in C++ the auto variables are in the default address space. Therefore cast alloca to the expected address space when necessary. Differential Revision: https://reviews.llvm.org/D32248 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303370 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Support implicit scalar to vector conversionsSimon Dardis2017-05-121-0/+6
| | | | | | | | | | | | | | | | | | | | This patch teaches clang to perform implicit scalar to vector conversions when one of the operands of a binary vector expression is a scalar which can be converted to the element type of the vector without truncation following GCC's implementation. If the (constant) scalar is can be casted safely, it is implicitly casted to the vector elements type and splatted to produce a vector of the same type. Contributions from: Petar Jovanovic Reviewers: bruno, vkalintiris Differential Revision: https://reviews.llvm.org/D25866 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302935 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Improve redefinition errors pointing to the same headerBruno Cardoso Lopes2017-05-111-0/+9
| | | | | | | | | | | | | | | | | | Diagnostics related to redefinition errors that point to the same header file do not provide much information that helps users fixing the issue. - In the modules context, it usually happens because of non modular includes. - When modules aren't involved it might happen because of the lack of header guards. Enhance diagnostics in these scenarios. Differential Revision: https://reviews.llvm.org/D28832 rdar://problem/31669175 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302765 91177308-0d34-0410-b5e6-96231b3b80d8