[PATCH] libstdc++: Reject user-defined specializations for coroutine_handle.
Jakub Jelinek
jakub@redhat.com
Sat Aug 1 00:55:24 GMT 2026
On Fri, Jul 31, 2026 at 05:00:55PM +0200, Tomasz Kamiński wrote:
> The P0912R5, "Merge Coroutines TS into C++20 working draft" that
> introduced them already included made specializing coroutine_handle
> ill-formed, no diagnostic required.
>
> This is QoI improvment, that produces diagnostic in such situation
> by decaroting base template with [[_Clang::__no_specializations]].
>
> libstdc++-v3/ChangeLog:
>
> * include/std/coroutine: Ignore -Winvalid-specialization in file.
> (std::coroutine_handle): Add clang::no_specializations attribute.
> * testsuite/18_support/coroutines/specializations_neg.cc: New test.
This regressed
+FAIL: g++.dg/coroutines/pr105475-3.C -std=c++20 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-3.C -std=c++23 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-3.C -std=c++26 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-3.C -std=c++29 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-broken-spec.C -std=c++20 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-broken-spec.C -std=c++23 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-broken-spec.C -std=c++26 (test for excess errors)
+FAIL: g++.dg/coroutines/pr105475-broken-spec.C -std=c++29 (test for excess errors)
(at least on i686-linux).
Jakub
More information about the Libstdc++
mailing list