public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pushed] c++: Add fixed test [PR88848]
@ 2023-12-08 18:46 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2023-12-08 18:46 UTC (permalink / raw)
  To: GCC Patches

Tested x86_64-pc-linux-gnu, applying to trunk.

-- >8 --
This one was fixed by r12-7714-g47da5198766256.

	PR c++/88848

gcc/testsuite/ChangeLog:

	* g++.dg/inherit/multiple2.C: New test.
---
 gcc/testsuite/g++.dg/inherit/multiple2.C | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/inherit/multiple2.C

diff --git a/gcc/testsuite/g++.dg/inherit/multiple2.C b/gcc/testsuite/g++.dg/inherit/multiple2.C
new file mode 100644
index 00000000000..dd3d0daf248
--- /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) };
+}

base-commit: 0c018a74eb1affe2a1fa385cdddaa93979683420
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-08 18:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08 18:46 [pushed] c++: Add fixed test [PR88848] Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).