Hello everybody,
I noticed strange problem using gcc4.6.2, see please attached file.
Compiling this file I get:
In member function 'void Test<_enum>::foo()':
error: declaration of 'Predicate _enum'
error: shadows template parm 'Enum _enum'
However it's enough to create intermediate object to avoid this problem
(it also compiles ok with gcc3.4.3).
Am I doing wrong something here or this is known problem?
Regards,
Bogdan
enum Enum {
Enum1
};
struct Predicate
{
Predicate( Enum ) {}
};
template< typename TPredicate >
struct Filter
{
Filter( TPredicate ) {}
};
template< Enum _enum >
struct Test
{
void foo()
{
Filter< Predicate > filter( Predicate( _enum ) ); //error is here
//this one compiles without any problem
//Predicate predicate( _enum );
//Filter< Predicate > filter( predicate );
}
};
int main( int _argc, char ** _argv )
{
Test< Enum1 > test;
return 0;
}