From 9177a016508696e664df5fa20ce44565978c34c4 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 14 May 2019 21:19:01 +0000 Subject: [PATCH] re PR c++/68918 (spurious "invalid use of incomplete type" in trailing return type) PR c++/68918 * g++.dg/cpp0x/decltype71.C: New test. From-SVN: r271193 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.dg/cpp0x/decltype71.C | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype71.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3dfe6b0550d..93aa83b58c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-05-14 Marek Polacek + PR c++/68918 + * g++.dg/cpp0x/decltype71.C: New test. + PR c++/70156 * g++.dg/init/static5.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype71.C b/gcc/testsuite/g++.dg/cpp0x/decltype71.C new file mode 100644 index 00000000000..24c3abfba49 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype71.C @@ -0,0 +1,25 @@ +// PR c++/68918 +// { dg-do compile { target c++11 } } + +struct foo { + static void a() {} + + auto b() const -> decltype( this->a() ) + {} + + template + auto c() -> decltype( this->a() ) + {} + + template + auto d() const -> decltype( a() ) + {} + + template + auto e() const -> decltype( this->a() ) + {} +}; + +int main() +{ +} -- 2.30.2