------- 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:

[EMAIL PROTECTED]:~/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’
[EMAIL PROTECTED]:~/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

Reply via email to