c++: Add fixed test [PR68451]
authorMarek Polacek <polacek@redhat.com>
Thu, 10 Dec 2020 14:56:40 +0000 (09:56 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 10 Dec 2020 14:59:42 +0000 (09:59 -0500)
I was about to add this test with dg-ice but it turned out it had
already been fixed by the recent r11-3361!

gcc/testsuite/ChangeLog:

PR c++/68451
* g++.dg/cpp0x/friend6.C: New test.

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

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