summaryrefslogtreecommitdiff
path: root/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for attribute 'noescape'.Akira Hatanaka2017-09-225-4/+70
| | | | | | | | | | | | | | | | | | | | The attribute informs the compiler that the annotated pointer parameter of a function cannot escape and enables IRGen to attach attribute 'nocapture' to parameters that are annotated with the attribute. That is the only optimization that currently takes advantage of 'noescape', but there are other optimizations that will be added later that improves IRGen for ObjC blocks. This recommits r313722, which was reverted in r313725 because clang couldn't build compiler-rt. It failed to build because there were function declarations that were missing 'noescape'. That has been fixed in r313929. rdar://problem/19886775 Differential Revision: https://reviews.llvm.org/D32210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313945 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress Wsign-conversion for enums with matching underlying typeErich Keane2017-09-211-1/+4
| | | | | | | | | | | | | | | | As reported here: https://bugs.llvm.org/show_bug.cgi?id=34692 A non-defined enum with a backing type was always defaulting to being treated as a signed type. IN the case where it IS defined, the signed-ness of the actual items is used. This patch uses the underlying type's signed-ness in the non-defined case to test signed-comparision. Differential Revision: https://reviews.llvm.org/D38145 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313907 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Prevent InstantiateClass from checking unrelated exception specs.Volodymyr Sapsai2017-09-211-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sema::InstantiateClass should check only exception specs added during class instantiation and ignore already present delayed specs. This fixes a case where we instantiate a class before parsing member initializers, check exceptions for a different class and fail to find a member initializer. Which is required for comparing exception specs for explicitly-defaulted and implicit default constructor. With the fix we are still checking exception specs but only after member initializers are present. Removing errors in crash-unparsed-exception.cpp is acceptable according to discussion in PR24000 because other compilers accept code in crash-unparsed-exception.cpp as valid. rdar://problem/34167492 Reviewers: davide, rsmith Reviewed By: rsmith Subscribers: dim, cfe-commits Differential Revision: https://reviews.llvm.org/D37881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313906 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix using old initializer during switch statement transformation.Volodymyr Sapsai2017-09-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | It fixes a crash in CodeGen when we are trying to generate code for initializer expression created before template instantiation, like CallExpr '<dependent type>' |-UnresolvedLookupExpr '<overloaded function type>' lvalue (ADL) = 'parse' `-DeclRefExpr 'Buffer<N>' lvalue ParmVar 'buffer' 'Buffer<N>' rdar://problem/33888545 Reviewers: rsmith, ahatanak Reviewed By: ahatanak Subscribers: aemerson, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D38009 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313896 91177308-0d34-0410-b5e6-96231b3b80d8
* [fixup][Sema] Allow in C to define tags inside enumerations.Volodymyr Sapsai2017-09-211-1/+2
| | | | | | | | | | | | | | | | | Fix for too aggressive error err_type_defined_in_enum introduced in r313386. Defining tags inside enumerations is prohibited in C++ but allowed in C. Reviewers: aaron.ballman, rnk, doug.gregor Reviewed By: rnk Subscribers: alberto_magni, cfe-commits Differential Revision: https://reviews.llvm.org/D38109 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313894 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Use canonical declarations for redeclarations checks.Alexey Bataev2017-09-211-3/+6
| | | | | | | | | If the captured variable has some redeclarations we may run into the situation where the redeclaration is used instead of the canonical declaration and we may consider this variable as one not captured before. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313880 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Give external linkage and mangling to lambdas inside inline ↵Vitaly Buka2017-09-213-30/+22
| | | | | | | | | | variables and variable templates." To fix: runtime error: load of value 15, which is not a valid value for type 'clang::LVComputationKind' This reverts commit r313827. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313856 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS Compat]Allow __interfaces to have properties.Erich Keane2017-09-201-247/+250
| | | | | | | | | | | | __interface types are allowed in MSVC to have "property" data members (marked with declspec property). This patch alters Sema to allow property data members. Differential Revision: https://reviews.llvm.org/D38092 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313828 91177308-0d34-0410-b5e6-96231b3b80d8
* Give external linkage and mangling to lambdas inside inline variables and ↵Richard Smith2017-09-203-22/+30
| | | | | | | | | variable templates. This implements the proposed approach in https://github.com/itanium-cxx-abi/cxx-abi/issues/33 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313827 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace r313747, don't always warn on enums, rework testcases.Roman Lebedev2017-09-201-8/+4
| | | | | | | | | | | | | As Aaron Ballman has pointed out, that is not really correct. So the key problem there is the invalidity of the testcase. Revert r313747, and rework testcase in such a way, so these details (platform-specific default enum sigdness) are accounted for. Also, add a C++-specific testcase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313756 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] CheckTautologicalComparisonWithZero(): always complain about enumsRoman Lebedev2017-09-201-4/+8
| | | | | | | | | | | | Hopefully fixes test-clang-msc-x64-on-i686-linux-RA build. The underlying problem is that the enum is signed there. Yet still, it is invalid for it to contain negative values, so the comparison is always tautological in this case. No differential, but related to https://reviews.llvm.org/D37629 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313747 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compareRoman Lebedev2017-09-201-17/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit. Original commit was reverted because buildbots broke. The error was only reproducible in the build with assertions. The problem was that the diagnostic expected true/false as bool, while it was provided as string "true"/"false". Summary: As requested by Sam McCall: > Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX) > The warning strongly suggests that the enum < 0 check has no effect > (for enums with nonnegative ranges). > Clang doesn't seem to optimize such checks out though, and they seem > likely to catch bugs in some cases. Yes, only if there's UB elsewhere, > but I assume not optimizing out these checks indicates a deliberate > decision to stay somewhat compatible with a technically-incorrect > mental model. > If this is the case, should we move these to a > -Wtautological-compare-enum subcategory? Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper Reviewed By: aaron.ballman Subscribers: jroelofs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37629 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313745 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++ [basic.link]p8.Richard Smith2017-09-203-34/+61
| | | | | | | | | | | | | | | If a function or variable has a type with no linkage (and is not extern "C"), any use of it requires a definition within the same translation unit; the idea is that it is not possible to define the entity elsewhere, so any such use is necessarily an error. There is an exception, though: some types formally have no linkage but nonetheless can be referenced from other translation units (for example, this happens to anonymous structures defined within inline functions). For entities with those types, we suppress the diagnostic except under -pedantic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313729 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add support for attribute 'noescape'."Akira Hatanaka2017-09-205-70/+4
| | | | | | | | | | This reverts commit r313722. It looks like compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc cannot be compiled because some of the functions declared in the file do not match the ones in the SDK headers (which are annotated with 'noescape'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313725 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for attribute 'noescape'.Akira Hatanaka2017-09-205-4/+70
| | | | | | | | | | | | | | | The attribute informs the compiler that the annotated pointer parameter of a function cannot escape and enables IRGen to attach attribute 'nocapture' to parameters that are annotated with the attribute. That is the only optimization that currently takes advantage of 'noescape', but there are other optimizations that will be added later that improves IRGen for ObjC blocks. rdar://problem/19886775 Differential Revision: https://reviews.llvm.org/D32210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313722 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add support for attribute 'noescape'."Akira Hatanaka2017-09-205-70/+4
| | | | | | | | This reverts r313717. I closed the wrong phabricator review. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313721 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for attribute 'noescape'.Akira Hatanaka2017-09-205-4/+70
| | | | | | | | | | | | | | | The attribute informs the compiler that the annotated pointer parameter of a function cannot escape and enables IRGen to attach attribute 'nocapture' to parameters that are annotated with the attribute. That is the only optimization that currently takes advantage of 'noescape', but there are other optimizations that will be added later that improves IRGen for ObjC blocks. rdar://problem/19886775 Differential Revision: https://reviews.llvm.org/D32520 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313720 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema][ObjC] Warn about mismatches in attributes between overriding andAkira Hatanaka2017-09-201-28/+30
| | | | | | | | | | | | | overridden methods when compiling for non-ARC. Previously, clang would error out when compiling for ARC, but didn't print any diagnostics when compiling for non-ARC. This was pointed out in the patch review for attribute noescape: https://reviews.llvm.org/D32210 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313717 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare"Roman Lebedev2017-09-191-25/+17
| | | | | | | | | | | | | | | | This reverts commit r313677. Buildbots fail with assertion failure Failing Tests (7): Clang :: Analysis/null-deref-ps.c Clang :: CodeGen/enum.c Clang :: Sema/compare.c Clang :: Sema/outof-range-constant-compare.c Clang :: Sema/tautological-unsigned-enum-zero-compare.c Clang :: Sema/tautological-unsigned-zero-compare.c Clang :: SemaCXX/compare.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313683 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compareRoman Lebedev2017-09-191-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As requested by Sam McCall: > Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX) > The warning strongly suggests that the enum < 0 check has no effect > (for enums with nonnegative ranges). > Clang doesn't seem to optimize such checks out though, and they seem > likely to catch bugs in some cases. Yes, only if there's UB elsewhere, > but I assume not optimizing out these checks indicates a deliberate > decision to stay somewhat compatible with a technically-incorrect > mental model. > If this is the case, should we move these to a > -Wtautological-compare-enum subcategory? Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper Reviewed By: aaron.ballman Subscribers: jroelofs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37629 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313677 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) valuesRachel Craik2017-09-191-5/+11
| | | | | | | | | | | | 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/trunk@313675 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach clang to tolerate the 'p = nullptr + n' idiom used by glibcAndrew Kaylor2017-09-191-0/+46
| | | | | | | | Differential Revision: https://reviews.llvm.org/D37042 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313666 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Disallow assigning record lvalues with nested const-qualified fields.Bjorn Pettersson2017-09-191-10/+74
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: According to C99 6.3.2.1p1, structs and unions with nested const-qualified fields (that is, const-qualified fields declared at some recursive level of the aggregate) are not modifiable lvalues. However, Clang permits assignments of these lvalues. With this patch, we both prohibit the assignment of records with const-qualified fields and emit a best-effort diagnostic. This fixes https://bugs.llvm.org/show_bug.cgi?id=31796 . Committing on behalf of bevinh (Bevin Hansson). Reviewers: rtrieu, rsmith, bjope Reviewed By: bjope Subscribers: Ka-Ka, rogfer01, bjope, fhahn, cfe-commits Differential Revision: https://reviews.llvm.org/D37254 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313628 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Fix a pair of crashes when generating exception specifiers with anErich Keane2017-09-181-1/+2
| | | | | | | | | | | | | | | | | | error'ed field for a template class' default ctor. The two examples in the test would both cause a compiler assert when attempting to calculate the exception specifier for the default constructor for the template classes. The problem was that dependents of this function expect that Field->getInClassInitializer (including canThrow) is not nullptr. However, if the template's initializer has an error, exactly that situation happens. This patch simply sets the field to be invalid. Differential Revision: https://reviews.llvm.org/D37865 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313569 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the second half of PR34266: Don't implicitly capture '*this' if the ↵Faisal Vali2017-09-172-47/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | members are found in a class unrelated to the enclosing class. https://bugs.llvm.org/show_bug.cgi?id=34266 For e.g. struct A { void f(int); static void f(char); }; struct B { auto foo() { return [&] (auto a) { A::f(a); // this should not cause a capture of '*this' }; } }; The patch does the following: 1) It moves the check to attempt an implicit capture of '*this' by reference into the more logical location of when the call is actually built within ActOnCallExpr (as opposed to when the unresolved-member-lookup node is created). - Reminder: A capture of '*this' by value has to always be an explicit capture. 2) It additionally checks whether the naming class of the UnresolvedMemberExpr ('A' in the example above) is related to the enclosing class ('B' above). P.S. If you have access to ISO-C++'s CWG reflector, see this thread for some potentially related discussion: http://lists.isocpp.org/core/2017/08/2851.php git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313487 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Error out early for tags defined inside an enumeration.Volodymyr Sapsai2017-09-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes PR28903 by avoiding access check for inner enum constant. We are performing access check because one enum constant references another and because enum is defined in CXXRecordDecl. But access check doesn't work because FindDeclaringClass doesn't expect more than one EnumDecl and because inner enum has access AS_none due to not being an immediate child of a record. The change detects an enum is defined in wrong place and allows to skip parsing its body. Access check is skipped together with body parsing. There was no crash in C, added test case to cover the new error. rdar://problem/28530809 Reviewers: rnk, doug.gregor, rsmith Reviewed By: doug.gregor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37089 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313386 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the __interface inheritence rules to work better with IUnknown and IDispatchErich Keane2017-09-151-1/+1
| | | | | | | | | | | | | | __interface objects in MSVC are permitted to inherit from __interface types, and interface-like types. Additionally, there are two default interface-like types (IUnknown and IDispatch) that all interface-like types must inherit from. Differential Revision: https://reviews.llvm.org/D37308 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313364 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] Correct typos in LHS, RHS before building a binop expression.Volodymyr Sapsai2017-09-151-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, typo correction should be done before dispatching between different kinds of binary operations like pseudo-object assignment, overloaded binary operation, etc. Without this change we hit an assertion Assertion failed: (!LHSExpr->hasPlaceholderType(BuiltinType::PseudoObject)), function CheckAssignmentOperands when in Objective-C we reference a property without `self` and there are 2 equally good typo correction candidates: ivar and a class name. In this case LHS expression in `BuildBinOp` is CXXDependentScopeMemberExpr `-TypoExpr and instead of handling Obj-C property assignment as pseudo-object assignment, we call `CreateBuiltinBinOp` which corrects typo to ObjCPropertyRefExpr '<pseudo-object type>' but cannot handle pseudo-objects and asserts about it (indirectly, through `CheckAssignmentOperands`). rdar://problem/33102722 Reviewers: rsmith, ahatanak, majnemer Reviewed By: ahatanak Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37322 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313323 91177308-0d34-0410-b5e6-96231b3b80d8
* Diagnostic specific failed condition in a static_assert.Douglas Gregor2017-09-142-16/+37
| | | | | | | | When a static_assert fails, dig out a specific condition to diagnose, using the same logic that we use to find the enable_if condition to diagnose. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313315 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Allow all classes as mappable types.Alexey Bataev2017-09-131-44/+0
| | | | | | | According to upcoming OpenMP 5.0 all classes/structs are now considered as mappable, even polymorphic and with static members. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313141 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][SemaStmtAsm] small refactoring, NFC.Coby Tayree2017-09-101-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312882 91177308-0d34-0410-b5e6-96231b3b80d8
* Catch more cases with -Wenum-compareRichard Trieu2017-09-092-4/+8
| | | | | | | | Treat typedef enum as named enums instead of anonymous enums. Anonymous enums are ignored by the warning, so previously, typedef enums were ignored as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312842 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-085-4/+13
| | | | | | | | | This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312794 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't show deleted function (constructor) candidates for code completionErik Verbruggen2017-09-081-1/+4
| | | | | | | | | | | In case of copy constructor is implicitly deleted it's still shown. PR34402 describes a way to reproduce that. Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D37435 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312785 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add _Float16 as a C/C++ source language type"Sjoerd Meijer2017-09-085-13/+4
| | | | | | | | The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312784 91177308-0d34-0410-b5e6-96231b3b80d8
* Add _Float16 as a C/C++ source language typeSjoerd Meijer2017-09-085-4/+13
| | | | | | | | | | | | This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312781 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sema] -Wtautological-compare: handle comparison of unsigned with 0S.Roman Lebedev2017-09-071-28/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a first half(?) of a fix for the following bug: https://bugs.llvm.org/show_bug.cgi?id=34147 (gcc -Wtype-limits) GCC's -Wtype-limits does warn on comparison of unsigned value with signed zero (as in, with 0), but clang only warns if the zero is unsigned (i.e. 0U). Also, be careful not to double-warn, or falsely warn on comparison of signed/fp variable and signed 0. Yes, all these testcases are needed. Testing: $ ninja check-clang-sema check-clang-semacxx Also, no new warnings for clang stage-2 build. Reviewers: rjmccall, rsmith, aaron.ballman Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37565 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312750 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IDNS_Tag to C++ declarations that conflict with tag declarations.Richard Smith2017-09-071-10/+8
| | | | | | | | Fixes some accepts-invalids with tags and other declarations declared in the same scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312743 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenCL] Handle taking an address of block captures.Anastasia Stulova2017-09-071-12/+11
| | | | | | | | | | | | | | | | | | Block captures can have different physical locations in memory segments depending on the use case (as a function call or as a kernel enqueue) and in different vendor implementations. Therefore it's unclear how to add address space to capture addresses uniformly. Currently it has been decided to disallow taking addresses of captured variables until further clarifications in the spec. Differential Revision: https://reviews.llvm.org/D36410 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312728 91177308-0d34-0410-b5e6-96231b3b80d8
* P0702R1: in class template argument deduction from a list of one element, ifRichard Smith2017-09-072-0/+32
| | | | | | | | that element's type is (or is derived from) a specialization of the deduced template, skip the std::initializer_list special case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312703 91177308-0d34-0410-b5e6-96231b3b80d8
* [CSA] [NFC] Move AnalysisContext.h to AnalysisDeclContext.hGeorge Karpenkov2017-09-061-1/+1
| | | | | | | | | | | | | | The implementation is in AnalysisDeclContext.cpp and the class is called AnalysisDeclContext. Making those match up has numerous benefits, including: - Easier jump from header to/from implementation. - Easily identify filename from class. Differential Revision: https://reviews.llvm.org/D37500 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312671 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-062-16/+35
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312638 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms] Implement the __annotation intrinsicReid Kleckner2017-09-051-0/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312572 91177308-0d34-0410-b5e6-96231b3b80d8
* [coroutines] Make sure auto return type of await_resume is properly handledGor Nishanov2017-09-051-2/+2
| | | | | | | | | | | | Reviewers: rsmith, EricWF Reviewed By: rsmith Subscribers: javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D37454 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312565 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Itanium name mangling support for C++ Modules TS.Richard Smith2017-09-042-10/+28
| | | | | | | | | | | | | This follows the scheme agreed with Nathan Sidwell, which can be found here: https://gcc.gnu.org/wiki/cxx-modules?action=AttachFile This will be proposed to the itanium-cxx-abi list once we have some experience with how well it works; the ABI for this TS should be considered unstable until it is part of the Itanium C++ ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312467 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR34398: assert with random access iterator if theAlexey Bataev2017-08-311-2/+2
| | | | | | | | | | | | step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312292 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress -Wdelete-non-virtual-dtor warnings about classes defined in system ↵Nico Weber2017-08-311-0/+6
| | | | | | | | | | | | | | | | | headers. r312167 made it so that we emit Wdelete-non-virtual-dtor from delete statements that are in system headers (e.g. std::unique_ptr). That works great on Linux and macOS, but on Windows there are non-final classes that are defined in system headers that have virtual methods but non-virtual destructors and yet get deleted through a base class pointer (e.g. ATL::CAccessToken::CRevert). So paddle back a bit and don't emit the warning if it's about a class defined in a system header. https://reviews.llvm.org/D37324 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312216 91177308-0d34-0410-b5e6-96231b3b80d8
* Let -Wdelete-non-virtual-dtor fire in system headers too.Nico Weber2017-08-301-1/+1
| | | | | | | | | | | | | | Makes the warning useful again in a std::unique_ptr world, PR28460. Also make the warning not fire in unevaluated contexts, since system libraries (e.g. libc++) do do that. This would've been a good change before we started emitting this warning in system headers too, but "normal" code seems to be less template-heavy, so we didn't notice until now. https://reviews.llvm.org/D37235 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312167 91177308-0d34-0410-b5e6-96231b3b80d8
* Give a better error if auto deduction fails due to inconsistent element ↵Richard Smith2017-08-301-25/+67
| | | | | | types in a braced initializer list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312085 91177308-0d34-0410-b5e6-96231b3b80d8
* PR10147: When substituting a template template argument, substitute in the mostRichard Smith2017-08-291-9/+5
| | | | | | | | recent (non-friend) declaration to pick up the right set of default template arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312049 91177308-0d34-0410-b5e6-96231b3b80d8