[pushed] c++: add fixed test [PR94100]

Message ID 20250204223451.55084-1-polacek@redhat.com
State New
Headers
Series [pushed] c++: add fixed test [PR94100] |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed

Commit Message

Marek Polacek Feb. 4, 2025, 10:34 p.m. UTC
  Tested x86_64-pc-linux-gnu, applying to trunk.

-- >8 --
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 | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/cpp0x/variadic188.C


base-commit: a64d9c96d8ebb0ba2a52daec85779b1a99c2f7fd
  

Patch

diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic188.C b/gcc/testsuite/g++.dg/cpp0x/variadic188.C
new file mode 100644
index 00000000000..04732a5e68f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic188.C
@@ -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; }