summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx1z-class-template-argument-deduction.cpp
Commit message (Collapse)AuthorAgeFilesLines
* clang/test/Parser/cxx1z-class-template-argument-deduction.cpp: Tweak to ↵NAKAMURA Takumi2017-02-141-1/+1
| | | | | | | | ignore thiscall. Line 38: multiple overloads of 'f' instantiate to the same signature 'void (int) __attribute__((thiscall))' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295020 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Synthesize implicit deduction guides from constructors on demand. RankRichard Smith2017-02-141-15/+13
| | | | | | | | | | | | | | | | | | | | such guides below explicit ones, and ensure that references to the class's template parameters are not treated as forwarding references. We make a few tweaks to the wording in the current standard: 1) The constructor parameter list is copied faithfully to the deduction guide, without losing default arguments or a varargs ellipsis (which the standard wording loses by omission). 2) If the class template declares no constructors, we add a T() -> T<...> guide (which will only ever work if T has default arguments for all non-pack template parameters). 3) If the class template declares nothing that looks like a copy or move constructor, we add a T(T<...>) -> T<...> guide. #2 and #3 follow from the "pretend we had a class type with these constructors" philosophy for deduction guides. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295007 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] Require an initializer for deduced class template specialization types.Richard Smith2017-02-101-2/+2
| | | | | | | | | It's actually meaningful and useful to allow such variables to have no initializer, but we are strictly following the standard here until the C++ committee reaches consensus on allowing this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294785 91177308-0d34-0410-b5e6-96231b3b80d8
* [c++1z] P0091R3: Basic support for deducing class template arguments via ↵Richard Smith2017-02-091-45/+53
| | | | | | deduction-guides. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294613 91177308-0d34-0410-b5e6-96231b3b80d8
* Towards P0091R3: parsing support for class template argument deduction in ↵Richard Smith2017-01-301-1/+58
| | | | | | | | | | typename-specifiers. This reinstates r293455, reverted in r293455, with a fix for cv-qualifier handling on dependent typename-specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293544 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r293455, which breaks v8 with a spurious error. Testcase added.Sam McCall2017-01-301-58/+1
| | | | | | | | | | | | Summary: Revert r293455, which breaks v8 with a spurious error. Testcase added. Reviewers: klimek Subscribers: cfe-commits, rsmith Differential Revision: https://reviews.llvm.org/D29271 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293473 91177308-0d34-0410-b5e6-96231b3b80d8
* Towards P0091R3: parsing support for class template argument deduction in ↵Richard Smith2017-01-301-1/+58
| | | | | | typename-specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293455 91177308-0d34-0410-b5e6-96231b3b80d8
* PR0091R3: Implement parsing support for using templates as types.Richard Smith2017-01-261-0/+131
This change adds a new type node, DeducedTemplateSpecializationType, to represent a type template name that has been used as a type. This is modeled around AutoType, and shares a common base class for representing a deduced placeholder type. We allow deduced class template types in a few more places than the standard does: in conditions and for-range-declarators, and in new-type-ids. This is consistent with GCC and with discussion on the core reflector. This patch does not yet support deduced class template types being named in typename specifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@293207 91177308-0d34-0410-b5e6-96231b3b80d8