9715663f7d
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. |
||
---|---|---|
.. | ||
config | ||
doc | ||
include | ||
libsupc++ | ||
po | ||
python | ||
scripts | ||
src | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
ChangeLog | ||
ChangeLog-1998 | ||
ChangeLog-1999 | ||
ChangeLog-2000 | ||
ChangeLog-2001 | ||
ChangeLog-2002 | ||
ChangeLog-2003 | ||
ChangeLog-2004 | ||
ChangeLog-2005 | ||
ChangeLog-2006 | ||
ChangeLog-2007 | ||
ChangeLog-2008 | ||
ChangeLog-2009 | ||
ChangeLog-2010 | ||
ChangeLog-2011 | ||
ChangeLog-2012 | ||
ChangeLog-2013 | ||
ChangeLog-2014 | ||
ChangeLog-2015 | ||
ChangeLog-2016 | ||
ChangeLog-2017 | ||
ChangeLog-2018 | ||
ChangeLog-2019 | ||
config.h.in | ||
configure | ||
configure.ac | ||
configure.host | ||
crossconfig.m4 | ||
fragment.am | ||
linkage.m4 | ||
Makefile.am | ||
Makefile.in | ||
README |
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.