From: Patrick Palka Date: Sun, 26 Jul 2020 17:37:26 +0000 (-0400) Subject: c++: Add testcase for [PR79504] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=798ff1c3e10c6926263f17704137e8c1a0d39be0;p=gcc.git c++: Add testcase for [PR79504] We successfully compile this testcase ever since r8-5270. gcc/testsuite/ChangeLog: PR c++/79504 * g++.dg/cpp0x/decltype79.C: New test. --- diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype79.C b/gcc/testsuite/g++.dg/cpp0x/decltype79.C new file mode 100644 index 00000000000..50c292a1958 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype79.C @@ -0,0 +1,19 @@ +// PR c++/79504 +// { dg-do compile { target c++11 } } + +struct A +{ + void f () & {} + + template + auto f (Args &&... args) && -> decltype (this->f (args...)) + { + return this->f (args...); + } +}; + +int main (){ + A p; + p.f (); + A{}.f(); +}