c++: Add fixed test [PR96474]
authorMarek Polacek <polacek@redhat.com>
Wed, 3 Mar 2021 20:10:21 +0000 (15:10 -0500)
committerMarek Polacek <polacek@redhat.com>
Wed, 3 Mar 2021 20:12:07 +0000 (15:12 -0500)
Was happy to find out that my recent dguide fix (r11-7483) fixed
this test too.  In particular, the

+  /* Wait until the enclosing scope is non-dependent.  */
+  if (DECL_CLASS_SCOPE_P (tmpl)
+      && dependent_type_p (DECL_CONTEXT (tmpl)))
+    return ptype;

bit.

gcc/testsuite/ChangeLog:

PR c++/96474
* g++.dg/cpp1z/class-deduction83.C: New test.

gcc/testsuite/g++.dg/cpp1z/class-deduction83.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C
new file mode 100644 (file)
index 0000000..63eab6a
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/96474
+// { dg-do compile { target c++17 } }
+
+template <typename = void>
+struct A
+{
+    template <typename = void>
+    struct B
+    {
+    };
+};
+    
+A<>::B b;