From: Nathaniel Shead Date: Thu, 23 Oct 2025 02:34:01 +0000 (+1100) Subject: c++: Override input location in diagnose_trait_expr X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b579bcfa1c8d719aae27bd35968cc7d6f4c76205;p=thirdparty%2Fgcc.git c++: Override input location in diagnose_trait_expr gcc/cp/ChangeLog: * constraint.cc (diagnose_trait_expr): Reset input_location. Signed-off-by: Nathaniel Shead Reviewed-by: Jason Merrill --- diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index e99c604babf..5b7eb36b460 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -3075,6 +3075,9 @@ diagnose_trait_expr (location_t loc, tree expr, tree args) tree t1 = TRAIT_EXPR_TYPE1 (expr); tree t2 = TRAIT_EXPR_TYPE2 (expr); + gcc_checking_assert (t1 != error_mark_node && t2 != error_mark_node); + + iloc_sentinel ils (loc); /* For traits intrinsically about the properties of user-defined types, decl_loc will point to the declaration of that type. */