diff mbox series

[pushed] c++: Add fixed test [PR96474]

Message ID 20210303201334.400944-1-polacek@redhat.com
State New
Headers show
Series [pushed] c++: Add fixed test [PR96474] | expand

Commit Message

Marek Polacek March 3, 2021, 8:13 p.m. UTC
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.

Tested x86_64-pc-linux-gnu, applying to trunk.

gcc/testsuite/ChangeLog:

	PR c++/96474
	* g++.dg/cpp1z/class-deduction83.C: New test.
---
 gcc/testsuite/g++.dg/cpp1z/class-deduction83.C | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp1z/class-deduction83.C


base-commit: 499193a692efa33c9b2fe3ad8da0f4d5e5fd0e0c
diff mbox series

Patch

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;