public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9674] c++: add fixed test [PR100557]
@ 2024-03-26 14:43 Marek Polacek
0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2024-03-26 14:43 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c0e199e4dbe652cd16d7248f0bfe166540f5d95b
commit r14-9674-gc0e199e4dbe652cd16d7248f0bfe166540f5d95b
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Mar 26 10:39:48 2024 -0400
c++: add fixed test [PR100557]
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.
Diff:
---
gcc/testsuite/g++.dg/cpp2a/concepts-pr100557.C | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
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);
+}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-26 14:43 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:43 [gcc r14-9674] 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).