[Bug c++/35387] __PRETTY_FUNCTION__ produces inconsistent output
d dot frey at gmx dot de
gcc-bugzilla@gcc.gnu.org
Wed Feb 27 21:59:00 GMT 2008
------- Comment #4 from d dot frey at gmx dot de 2008-02-27 21:58 -------
More information:
I checked out the trunk and checked it again. The bug is still present, but
while testing it, I noticed that the problem does not occur with my own types,
only with types from the standard library. Here's the code I used:
#include <algorithm>
template< typename X, typename Y > struct P {};
template< typename > struct A;
template< typename T, typename U >
struct A< P< T, U > >
{ static void f() { int i; } };
template< typename V, typename W >
struct A< std::pair< V, W > >
{ static void f() { int i; } };
int main()
{
A< P< int, double > >::f();
A< std::pair< int, double > >::f();
}
and the output is:
frey@fiasko:~/work/test/foo$
/home/frey/work/svn/gcc/host-i686-pc-linux-gnu/gcc/g++
-B/home/frey/work/svn/gcc/host-i686-pc-linux-gnu/gcc/ -ansi -pedantic -Wall
-Wextra
-I/home/frey/work/svn/gcc/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
-I/home/frey/work/svn/gcc/i686-pc-linux-gnu/libstdc++-v3/include
-I/home/frey/work/svn/gcc/libstdc++-v3/libsupc++ foo.cpp -c -o foo
foo.cpp: In static member function Âstatic void A<P<T, U> >::f() [with T = int,
U = double]Â:
foo.cpp:12: instantiated from here
foo.cpp:7: warning: unused variable ÂiÂ
foo.cpp: In static member function Âstatic void A<std::pair<_T1, _T2> >::f()
[with V = int, W = double]Â:
foo.cpp:13: instantiated from here
foo.cpp:8: warning: unused variable ÂiÂ
frey@fiasko:~/work/test/foo$
/home/frey/work/svn/gcc/host-i686-pc-linux-gnu/gcc/g++ --version
g++ (GCC) 4.4.0 20080227 (experimental)
[snip]
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35387
More information about the Gcc-bugs
mailing list