[PATCH] c++, libstdc++, v4: Implement C++26 P2641R4 - Checking if a union alternative is active
Jason Merrill
jason@redhat.com
Tue Sep 1 16:58:00 GMT 2026
On 9/1/26 11:53 AM, Jakub Jelinek wrote:
> + if (!valp || *valp == void_list_node)
> + {
> + if (!ctx->quiet)
> + {
> + auto_diagnostic_group d;
> + if (DECL_P (obj) && DECL_NAME (obj) == heap_deleted_identifier)
> + {
> + error_at (loc, "%qs on allocated storage after deallocation "
> + "is not a constant expression",
> + "__builtin_is_within_lifetime");
> + inform (DECL_SOURCE_LOCATION (obj), "allocated here");
> + }
> + else if (DECL_P (obj) && ctx->global->is_outside_lifetime (obj))
> + {
> + error_at (loc, "%qs on %qE outside its lifetime is not a "
> + "constant expression",
Let's also clarify this message to talk about storage. OK with that
adjustment.
Jason
More information about the Libstdc++
mailing list