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