]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Override input location in diagnose_trait_expr
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 23 Oct 2025 02:34:01 +0000 (13:34 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 22 Nov 2025 23:45:09 +0000 (10:45 +1100)
gcc/cp/ChangeLog:

* constraint.cc (diagnose_trait_expr): Reset input_location.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/constraint.cc

index e99c604babfef6dd85c9c43659fe16c430d3e305..5b7eb36b4608ca9321103ca505c5059452748d44 100644 (file)
@@ -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.  */