re PR c++/68918 (spurious "invalid use of incomplete type" in trailing return type)
authorMarek Polacek <polacek@redhat.com>
Tue, 14 May 2019 21:19:01 +0000 (21:19 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 14 May 2019 21:19:01 +0000 (21:19 +0000)
PR c++/68918
* g++.dg/cpp0x/decltype71.C: New test.

From-SVN: r271193

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype71.C [new file with mode: 0644]

index 3dfe6b0550d81efa6923dd586dc168dcfe192221..93aa83b58c54a485f517a14333119ab32a1c50c7 100644 (file)
@@ -1,5 +1,8 @@
 2019-05-14  Marek Polacek  <polacek@redhat.com>
 
+       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 (file)
index 0000000..24c3abf
--- /dev/null
@@ -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<typename X>
+    auto c() -> decltype( this->a() )
+    {}
+
+    template<typename X>
+    auto d() const -> decltype( a() )
+    {}
+
+    template<typename X>
+    auto e() const -> decltype( this->a() )
+    {}
+};
+
+int main()
+{
+}