]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add testcase for PR103338
authorSimon Martin <simon@nasilyan.com>
Tue, 4 Jun 2024 09:59:31 +0000 (11:59 +0200)
committerSimon Martin <simon@nasilyan.com>
Tue, 4 Jun 2024 18:19:39 +0000 (20:19 +0200)
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.

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

diff --git a/gcc/testsuite/g++.dg/parse/crash73.C b/gcc/testsuite/g++.dg/parse/crash73.C
new file mode 100644 (file)
index 0000000..97b8b5e
--- /dev/null
@@ -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;