]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Adjust location of is_*_base_of diagnostics
authorNathaniel Shead <nathanieloshead@gmail.com>
Sat, 25 Oct 2025 13:01:30 +0000 (00:01 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 22 Nov 2025 23:45:11 +0000 (10:45 +1100)
commitc2ce1b55cd91ea81be2a9c357efa2579695e9f46
treeb314a868bc6b4fe2cebdf6b799015bd9f750fe56
parentb579bcfa1c8d719aae27bd35968cc7d6f4c76205
c++: Adjust location of is_*_base_of diagnostics

It makes more sense to point at the derived type (that didn't specify
the base class).

gcc/cp/ChangeLog:

* constraint.cc (diagnose_trait_expr): Use t2's location for
is_base_of, is_pointer_interconvertible_base_of, and
is_virtual_base_of.

gcc/testsuite/ChangeLog:

* g++.dg/ext/is_virtual_base_of_diagnostic2.C: Adjust
diagnostic.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/constraint.cc
gcc/testsuite/g++.dg/ext/is_virtual_base_of_diagnostic2.C