[gcc r15-1019] c++: Add testcase for PR103338

Simon Martin simartin@gcc.gnu.org
Tue Jun 4 18:23:34 GMT 2024


https://gcc.gnu.org/g:126ccf8ffc46865accec22a2789f09abd98c1d85

commit r15-1019-g126ccf8ffc46865accec22a2789f09abd98c1d85
Author: Simon Martin <simon@nasilyan.com>
Date:   Tue Jun 4 11:59:31 2024 +0200

    c++: Add testcase for PR103338
    
    The case in that PR used to ICE until commit f04dc89. This patch simply adds
    the case to the testsuite.
    
    Successfully tested on x86_64-pc-linux-gnu.
    
            PR c++/103388
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/parse/crash73.C: New test.

Diff:
---
 gcc/testsuite/g++.dg/parse/crash73.C | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gcc/testsuite/g++.dg/parse/crash73.C b/gcc/testsuite/g++.dg/parse/crash73.C
new file mode 100644
index 00000000000..97b8b5e8325
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/crash73.C
@@ -0,0 +1,19 @@
+// PR c++/103338
+// { dg-do compile { target c++11 } }
+
+template<class...>
+struct zip_view {
+  struct Iterator;
+};
+
+template<class...>
+struct zip_transform_view;
+
+template<class... Views>
+struct zip_view<Views...>::Iterator { // { dg-error "no class template" }
+  template<class... Uiews>
+  template<bool>
+  friend class zip_transform_view<Uiews...>::Iterator;
+};
+
+zip_view<>::Iterator iter;


More information about the Gcc-cvs mailing list