This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35387] __PRETTY_FUNCTION__ produces inconsistent output
- From: "d dot frey at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Feb 2008 12:02:51 -0000
- Subject: [Bug c++/35387] __PRETTY_FUNCTION__ produces inconsistent output
- References: <bug-35387-3237@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from d dot frey at gmx dot de 2008-02-27 12:02 -------
I understand where the names come from, but that doesn't make the message
correct. Consider the specialization in the example program to use <_T2,_T1>
(note the reversed order) and an instantiation with <int,double>, the resulting
message is:
static void A<std::pair<_T1, _T2> >::f() [with _T2 = int, _T1 = double]
which is *really* misleading. Since it's actually vice versa.
Additionally I just found out that the same problem also occurs within error
and warning messages from the compiler, so it's not limited to
__PRETTY_FUNCTION__. I triggered a warning for an unused variable, which reads:
foo.cpp: In static member function ?static void A<std::pair<_T1, _T2> >::f()
[with T = int, U = int]?:
foo.cpp:17: instantiated from here
foo.cpp:10: warning: unused variable ?i?
Regards, Daniel
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35387