]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: add fixed test [PR94100]
authorMarek Polacek <polacek@redhat.com>
Tue, 4 Feb 2025 22:32:50 +0000 (17:32 -0500)
committerMarek Polacek <polacek@redhat.com>
Tue, 4 Feb 2025 22:33:28 +0000 (17:33 -0500)
The recent r15-7339-g26d3424ca5d9f4 fixed this test too.

PR c++/94100

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/variadic188.C: New test.

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

diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic188.C b/gcc/testsuite/g++.dg/cpp0x/variadic188.C
new file mode 100644 (file)
index 0000000..04732a5
--- /dev/null
@@ -0,0 +1,23 @@
+// PR c++/94100
+// { dg-do compile { target c++11 } }
+
+template <typename... T> struct ValListWithTypes {
+  template <T... Members> struct WithVals {
+    using TypeList = ValListWithTypes;
+  };
+};
+
+template <typename ValList, typename ValTypeList = typename ValList::TypeList>
+struct Widget;
+
+template <typename ValList, typename... ValTypes>
+struct Widget<ValList, ValListWithTypes<ValTypes...>> {
+  template <typename = ValList> struct Impl {};
+};
+
+template <typename ValList, typename... ValTypes>
+template <ValTypes... Vals>
+struct Widget<ValList, ValListWithTypes<ValTypes...>>::Impl<
+    typename ValListWithTypes<ValTypes...>::template WithVals<Vals...>> {};
+
+int main(void) { Widget<ValListWithTypes<int>::WithVals<0>>::Impl<> impl; }