* [pushed] c++: add fixed test [PR100557]
@ 2024-03-26 14:44 Marek Polacek
0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2024-03-26 14:44 UTC (permalink / raw)
To: GCC Patches
Tested x86_64-pc-linux-gnu, applying to trunk.
-- >8 --
We used to hit the "Error reporting routines re-entered." ICE here but
it was fixed by Patrick's r14-3809.
PR c++/100557
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-pr100557.C: New test.
---
.../g++.dg/cpp2a/concepts-pr100557.C | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-pr100557.C
diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-pr100557.C b/gcc/testsuite/g++.dg/cpp2a/concepts-pr100557.C
new file mode 100644
index 00000000000..8dcd0eaca51
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-pr100557.C
@@ -0,0 +1,21 @@
+// PR c++/100557
+// { dg-do compile { target c++20 } }
+
+template <typename _Tp> _Tp declval();
+
+struct print_tag_;
+
+bool tag_invoke(print_tag_, auto);
+bool tag_invoke(print_tag_, auto obj) requires requires { *obj; };
+
+template <typename CPO, typename... Args>
+auto try_tag_invoke() noexcept(tag_invoke(declval<CPO>, declval<Args>()...)) // { dg-error "no matching function for call" }
+ -> decltype(tag_invoke(CPO(), declval<Args>()...));
+
+struct print_tag_ {
+ void operator()(auto... args) noexcept(noexcept( try_tag_invoke<print_tag_, decltype(args)...>()));
+} print;
+
+void foo() {
+ print(0);
+}
base-commit: 2f47ca046eecf8f2fcae23df3ccee44d943ef512
--
2.44.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-26 14:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-26 14:44 [pushed] c++: add fixed test [PR100557] 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).