gcc/libstdc++-v3/testsuite
Jakub Jelinek 9715663f7d c++: Change __builtin_source_location to use __PRETTY_FUNCTION__ instead of __FUNCTION__ [PR80780]
On Tue, Dec 01, 2020 at 01:03:52PM +0000, Jonathan Wakely via Gcc-patches wrote:
> I mentioned in PR 80780 that a __builtin__PRETTY_FUNCTION would have
> been nice, because __FUNCTION__ isn't very useful for C++, because of
> overloading and namespace/class scopes. There are an unlimited number
> of functions that have __FUNCTION__ == "s", e.g. "ns::s(int)" and
> "ns::s()" and "another_scope::s::s<T...>(T...)" etc.
>
> Since __builtin_source_location() can do whatever it wants (without
> needing to add __builtin__PRETTY_FUNCTION) it might be nice to use the
> __PRETTY_FUNCTION__ string. JeanHeyd's tests would still need changes,
> because the name would be "s::s(void*)" not "s::s" but that still
> seems better for users.

When I've added template tests for the previous patch, I have noticed that
the current __builtin_source_location behavior is not really __FUNCTION__,
just close, because e.g. in function template __FUNCTION__ is still
"bar" but __builtin_source_location gave "bar<0>".

Anyway, this patch implements above request to follow __PRETTY_FUNCTION__
(on top of the earlier posted patch).

2020-12-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/80780
	* cp-gimplify.c (fold_builtin_source_location): Use 2 instead of 0
	as last argument to cxx_printable_name.

	* g++.dg/cpp2a/srcloc1.C (quux): Use __PRETTY_FUNCTION__ instead of
	function.
	* g++.dg/cpp2a/srcloc2.C (quux): Likewise.
	* g++.dg/cpp2a/srcloc15.C (S::S): Likewise.
	(bar): Likewise.  Adjust expected column.
	* g++.dg/cpp2a/srcloc17.C (S::S): Likewise.
	(bar): Likewise.  Adjust expected column.

	* testsuite/18_support/source_location/1.cc (main): Adjust for
	__builtin_source_location using __PRETTY_FUNCTION__-like names instead
	__FUNCTION__-like.
	* testsuite/18_support/source_location/consteval.cc (main): Likewise.
2020-12-04 08:08:39 +01:00
..
17_intro libstdc++: Fix test failure on AIX 2020-11-25 17:22:47 +00:00
18_support c++: Change __builtin_source_location to use __PRETTY_FUNCTION__ instead of __FUNCTION__ [PR80780] 2020-12-04 08:08:39 +01:00
19_diagnostics
20_util libstdc++: Set dg-timeout-factor for more slow tests 2020-11-30 14:39:54 +00:00
21_strings libstdc++: Make _GLIBCXX_DEBUG checks constexpr compatible 2020-11-09 21:11:13 +01:00
22_locale
23_containers libstdc++: Disable std::array assertions for C++11 constexpr 2020-12-03 17:08:01 +00:00
24_iterators libstdc++: Fix missing subsumption in std::iterator_traits [PR 97935] 2020-11-25 17:22:47 +00:00
25_algorithms libstdc++: Set dg-timeout-factor for more slow tests 2020-11-30 14:39:54 +00:00
26_numerics libstdc++: Fix typos in #error strings 2020-12-03 19:31:19 +00:00
27_io libstdc++: Use longer timeout for istream::gcount() overflow tests 2020-12-02 12:34:20 +00:00
28_regex libstdc++: Set dg-timeout-factor for more slow tests 2020-11-30 14:39:54 +00:00
29_atomics Add feature test macro for atomic<T>::wait 2020-12-01 15:43:17 -08:00
30_threads libstdc++: Add "futex" and "gthreads" effective-target keywords 2020-11-26 16:15:52 +00:00
abi
backward
config
data
decimal
experimental libstdc++: Fix -Wrange-loop-construct warnings in filesystem tests 2020-11-27 13:34:22 +00:00
ext Add support for detecting mismatched allocation/deallocation calls. 2020-12-03 15:43:32 -07:00
lib libstdc++: Use libatomic for tests on all 32-bit powerpc targets 2020-12-02 16:37:56 +00:00
libstdc++-abi
libstdc++-dg
libstdc++-prettyprinters libstdc++: Fix filesystem::path pretty printer test failure 2020-12-02 00:39:21 +00:00
libstdc++-xmethods
performance libstdc++: Limit memory allocation in stable_sort/inplace_merge (PR 83938) 2020-11-20 22:25:04 +01:00
special_functions
std libstdc++: Fix ranges::join_view::_Iterator::operator-> [LWG 3500] 2020-11-18 10:23:57 -05:00
tr1 libstdc++: Prevent deprecation warnings from <tr1/shared_ptr> 2020-10-29 22:47:22 +00:00
tr2
util libstdc++: Fix testsuite helper functions [PR 97936] 2020-11-25 18:24:12 +00:00
Makefile.am
Makefile.in