From: Patrick Palka Date: Fri, 20 Mar 2020 17:06:21 +0000 (-0400) Subject: c++: Add testcases from PR c++/69694 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a23eff1bd04ebdca503376ae6198d95c737dc3de;p=gcc.git c++: Add testcases from PR c++/69694 These testcases are compiling successfully since 7.1. gcc/testsuite/ChangeLog: PR c++/69694 * g++.dg/cpp0x/decltype74.C: New test. * g++.dg/cpp0x/decltype75.C: New test. --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c9fff884146..76b93b570bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-03-20 Patrick Palka + + PR c++/69694 + * g++.dg/cpp0x/decltype74.C: New test. + * g++.dg/cpp0x/decltype75.C: New test. + 2020-03-20 Srinath Parvathaneni Andre Vieira Mihail Ionescu diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype74.C b/gcc/testsuite/g++.dg/cpp0x/decltype74.C new file mode 100644 index 00000000000..9ddd1c13e4f --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype74.C @@ -0,0 +1,30 @@ +// PR c++/69694 +// { dg-do compile { target c++11 } } + +// n3911: TransformationTrait Alias `void_t` +template struct make_void { using type = void; }; +template using void_t = typename make_void::type; + +// std::declval +void*& declval_void(); + +template struct Fun; +template + struct Fun +{ + void fun(); +}; +template + struct Fun> + : Fun +{ +}; + +struct Tag { static constexpr void* name = 0; }; + +template void a() +{ + Fun{}.fun(); +} + +void b() { a(); } diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype75.C b/gcc/testsuite/g++.dg/cpp0x/decltype75.C new file mode 100644 index 00000000000..0e97411af8b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype75.C @@ -0,0 +1,24 @@ +// PR c++/69694 +// This is a reduced version of decltype74.C. +// { dg-do compile { target c++11 } } + +template using void_t = void; + +extern void *declval_void; + +template struct Fun { }; + +template +struct Fun> +{ + void fun(); +}; + +struct Tag { static constexpr void* name = 0; }; + +template void a() +{ + Fun{}.fun(); +} + +void b() { a(); }