c++: Add test for PR96652
authorPatrick Palka <ppalka@redhat.com>
Tue, 22 Sep 2020 20:26:49 +0000 (16:26 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 22 Sep 2020 20:26:49 +0000 (16:26 -0400)
Fixed by r11-3361.

gcc/testsuite/ChangeLog:

PR c++/96652
* g++.dg/cpp0x/decltype-96652.C: New test.

gcc/testsuite/g++.dg/cpp0x/decltype-96652.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-96652.C b/gcc/testsuite/g++.dg/cpp0x/decltype-96652.C
new file mode 100644 (file)
index 0000000..249cce2
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/96652
+// { dg-do compile { target c++11 } }
+
+struct A {};
+
+template <typename T>
+struct B
+{
+  A m;
+  friend decltype(m);
+};
+
+A a;
+B<int> b;