J
J Cook
Can anyone explain this error? It seems as if the compiler is using
the name of the first parameter as the temporary object name?
class Foo
{
Foo(int s) {}
};
void foo()
{
int test = 4;
Foo(test); // create a temporary. Thinks it is named "test" ??
}
int main()
{
foo();
}
# In function 'void foo()'
# error: conflicting declaration 'Foo test'
# 'test' has a previous declaration as 'int test'
gcc 4.1.2
Thanks in advance,
JC
the name of the first parameter as the temporary object name?
class Foo
{
Foo(int s) {}
};
void foo()
{
int test = 4;
Foo(test); // create a temporary. Thinks it is named "test" ??
}
int main()
{
foo();
}
# In function 'void foo()'
# error: conflicting declaration 'Foo test'
# 'test' has a previous declaration as 'int test'
gcc 4.1.2
Thanks in advance,
JC