From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1888) id CF15D3858430; Thu, 27 Jan 2022 19:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF15D3858430 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Patrick Palka To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6901] c++: Add a couple of CTAD testcases [PR82632] X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/master X-Git-Oldrev: 7eb61a45a171d4f8f5bf4d4f469d42e657c69a6a X-Git-Newrev: fd59d5d4a2ef8a97541a22399480bc1f8e82ceca Message-Id: <20220127193420.CF15D3858430@sourceware.org> Date: Thu, 27 Jan 2022 19:34:20 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2022 19:34:20 -0000 https://gcc.gnu.org/g:fd59d5d4a2ef8a97541a22399480bc1f8e82ceca commit r12-6901-gfd59d5d4a2ef8a97541a22399480bc1f8e82ceca Author: Patrick Palka Date: Thu Jan 27 14:34:05 2022 -0500 c++: Add a couple of CTAD testcases [PR82632] PR c++/82632 gcc/testsuite/ChangeLog: * g++.dg/cpp1z/class-deduction104.C: New test. * g++.dg/cpp1z/class-deduction105.C: New test. Diff: --- gcc/testsuite/g++.dg/cpp1z/class-deduction104.C | 17 +++++++++++++++++ gcc/testsuite/g++.dg/cpp1z/class-deduction105.C | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction104.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction104.C new file mode 100644 index 00000000000..a34dea04675 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction104.C @@ -0,0 +1,17 @@ +// PR c++/82632 +// { dg-do compile { target c++17 } } + +template struct Optional { + template Optional(U&&); +}; + +template Optional(A) -> Optional; + +Optional opt(1729); +Optional dupe(opt); + +using ty1 = decltype(opt); +using ty1 = Optional; + +using ty2 = decltype(dupe); +using ty2 = Optional; diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction105.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction105.C new file mode 100644 index 00000000000..73a9c6b676a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction105.C @@ -0,0 +1,17 @@ +// PR c++/82632 +// { dg-do compile { target c++17 } } + +template +struct Foo { + Foo() = default; + Foo(const Foo&) = delete; + + template + Foo(const Foo&); +}; + +template +Foo(Foo) -> Foo; + +Foo a; +Foo b = a;