[gcc r11-7494] c++: Add fixed test [PR96474]

Marek Polacek mpolacek@gcc.gnu.org
Wed Mar 3 20:13:11 GMT 2021


https://gcc.gnu.org/g:49df367b17995c54fabe5bca290eede7dfab05b3

commit r11-7494-g49df367b17995c54fabe5bca290eede7dfab05b3
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Mar 3 15:10:21 2021 -0500

    c++: Add fixed test [PR96474]
    
    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.

Diff:
---
 gcc/testsuite/g++.dg/cpp1z/class-deduction83.C | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C
new file mode 100644
index 00000000000..63eab6a8442
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction83.C
@@ -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;


More information about the Gcc-cvs mailing list