aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2023-12-08 13:44:10 -0500
committerMarek Polacek <polacek@redhat.com>2023-12-08 13:44:54 -0500
commit2a5a5d5e7d32b21205562a35b307ff69e389b996 (patch)
tree3fd77c3ea8d536085f61dec6d9853d96780e606d
parent0c018a74eb1affe2a1fa385cdddaa93979683420 (diff)
downloadgcc-2a5a5d5e7d32b21205562a35b307ff69e389b996.zip
gcc-2a5a5d5e7d32b21205562a35b307ff69e389b996.tar.gz
gcc-2a5a5d5e7d32b21205562a35b307ff69e389b996.tar.bz2
c++: Add fixed test [PR88848]
This one was fixed by r12-7714-g47da5198766256. PR c++/88848 gcc/testsuite/ChangeLog: * g++.dg/inherit/multiple2.C: New test.
-rw-r--r--gcc/testsuite/g++.dg/inherit/multiple2.C35
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/inherit/multiple2.C b/gcc/testsuite/g++.dg/inherit/multiple2.C
new file mode 100644
index 0000000..dd3d0da
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/multiple2.C
@@ -0,0 +1,35 @@
+// PR c++/88848
+// { dg-do compile { target c++17 } }
+
+template<typename>
+struct True { static constexpr bool value{ true }; };
+
+template<int VALUE>
+struct Integer { static constexpr int value{ VALUE }; };
+
+template<int VALUE, typename TYPE>
+struct Foo
+{
+ using Integer_t = Integer<VALUE>;
+
+ static TYPE get_type(Integer_t);
+};
+
+template<typename... ARGS>
+struct Bar : ARGS...
+{
+ using ARGS::get_type...;
+
+ template<int VALUE>
+ using Type_t = decltype(get_type(Integer<VALUE>{}));
+
+ Bar() { static_assert((True< Type_t<ARGS::Integer_t::value> >::value && ...)); }
+
+ static_assert((True< Type_t<ARGS::Integer_t::value> >::value && ...));
+};
+
+int main()
+{
+ Bar<Foo<4, float>, Foo<8, double>> obj;
+ return int{ sizeof(obj) };
+}