gcc/libstdc++-v3/testsuite/26_numerics
Nathaniel Shead 5ebe5bcf8b c++: Improve location information in constant evaluation
This patch updates 'input_location' during constant evaluation to ensure
that errors in subexpressions that lack location information still
provide accurate diagnostics.

By itself this change causes some small regressions in diagnostic
quality for circumstances where errors used 'input_location' but the
location of the parent subexpression doesn't make sense, so this patch
also includes a small diagnostic improvement to fix the most egregious
case.

gcc/cp/ChangeLog:

	* constexpr.cc (modifying_const_object_error): Find the source
	location of the const object's declaration.
	(cxx_eval_constant_expression): Update input_location to the
	location of the currently evaluated expression, if possible.

libstdc++-v3/ChangeLog:

	* testsuite/25_algorithms/equal/constexpr_neg.cc: Update diagnostic
	locations.
	* testsuite/26_numerics/gcd/105844.cc: Likewise.
	* testsuite/26_numerics/lcm/105844.cc: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/constexpr-48089.C: Update diagnostic locations.
	* g++.dg/cpp0x/constexpr-70323.C: Likewise.
	* g++.dg/cpp0x/constexpr-70323a.C: Likewise.
	* g++.dg/cpp0x/constexpr-delete2.C: Likewise.
	* g++.dg/cpp0x/constexpr-diag3.C: Likewise.
	* g++.dg/cpp0x/constexpr-ice20.C: Likewise.
	* g++.dg/cpp0x/constexpr-mutable3.C: Likewise.
	* g++.dg/cpp0x/constexpr-recursion.C: Likewise.
	* g++.dg/cpp0x/overflow1.C: Likewise.
	* g++.dg/cpp1y/constexpr-89285.C: Likewise.
	* g++.dg/cpp1y/constexpr-89481.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const14.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const16.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const18.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const19.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const21.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const22.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const3.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const4.C: Likewise.
	* g++.dg/cpp1y/constexpr-tracking-const7.C: Likewise.
	* g++.dg/cpp1y/constexpr-union5.C: Likewise.
	* g++.dg/cpp1y/pr68180.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda6.C: Likewise.
	* g++.dg/cpp1z/constexpr-lambda8.C: Likewise.
	* g++.dg/cpp2a/bit-cast11.C: Likewise.
	* g++.dg/cpp2a/bit-cast12.C: Likewise.
	* g++.dg/cpp2a/bit-cast14.C: Likewise.
	* g++.dg/cpp2a/constexpr-98122.C: Likewise.
	* g++.dg/cpp2a/constexpr-dynamic17.C: Likewise.
	* g++.dg/cpp2a/constexpr-init1.C: Likewise.
	* g++.dg/cpp2a/constexpr-new12.C: Likewise.
	* g++.dg/cpp2a/constexpr-new3.C: Likewise.
	* g++.dg/cpp2a/constinit10.C: Likewise.
	* g++.dg/cpp2a/is-corresponding-member4.C: Likewise.
	* g++.dg/ext/constexpr-vla2.C: Likewise.
	* g++.dg/ext/constexpr-vla3.C: Likewise.
	* g++.dg/ubsan/pr63956.C: Likewise.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
2023-07-25 21:45:10 -04:00
..
accumulate Update copyright years. 2023-01-16 11:52:17 +01:00
adjacent_difference Update copyright years. 2023-01-16 11:52:17 +01:00
bit Update copyright years. 2023-01-16 11:52:17 +01:00
complex libstdc++: Stop using _GLIBCXX_USE_C99_MATH_TR1 in <cmath> 2023-05-31 21:01:16 +01:00
endian Update copyright years. 2023-01-16 11:52:17 +01:00
exclusive_scan Update copyright years. 2023-01-16 11:52:17 +01:00
gcd c++: Improve location information in constant evaluation 2023-07-25 21:45:10 -04:00
headers libstdc++: Stop using _GLIBCXX_USE_C99_MATH_TR1 in <cmath> 2023-05-31 21:01:16 +01:00
inclusive_scan Update copyright years. 2023-01-16 11:52:17 +01:00
inner_product Update copyright years. 2023-01-16 11:52:17 +01:00
iota Update copyright years. 2023-01-16 11:52:17 +01:00
lcm c++: Improve location information in constant evaluation 2023-07-25 21:45:10 -04:00
lerp Update copyright years. 2023-01-16 11:52:17 +01:00
midpoint Update copyright years. 2023-01-16 11:52:17 +01:00
numbers Update copyright years. 2023-01-16 11:52:17 +01:00
partial_sum Update copyright years. 2023-01-16 11:52:17 +01:00
pstl/numeric_ops libstdc++: Synchronize PSTL with upstream 2023-06-26 11:34:43 -07:00
random libstdc++: Fix some tests that fail with -fexcess-precision=standard 2023-06-07 16:51:59 +01:00
reduce Update copyright years. 2023-01-16 11:52:17 +01:00
slice Update copyright years. 2023-01-16 11:52:17 +01:00
slice_array Update copyright years. 2023-01-16 11:52:17 +01:00
transform_exclusive_scan Update copyright years. 2023-01-16 11:52:17 +01:00
transform_inclusive_scan Update copyright years. 2023-01-16 11:52:17 +01:00
transform_reduce Update copyright years. 2023-01-16 11:52:17 +01:00
valarray libstdc++: Fix some tests that fail with -fexcess-precision=standard 2023-06-07 16:51:59 +01:00