N
nymano
Hi.
Could someone please lend me a hand with a simple g++ problem.
Be so kind and consider the following code:
class A
{
public:
A() {}
};
int main()
{
(A());
return 0;
}
Yields the following error using g++:
In function `int main()':
syntax error before `;' token
It seems to me, the compiler considers (A()) to be a cast rather than a
constructor? Does this g++ "misbehaviour" conform to the C++ standard
or is this a bug in g++?
thanks in advance,
Stoyan.
Could someone please lend me a hand with a simple g++ problem.
Be so kind and consider the following code:
class A
{
public:
A() {}
};
int main()
{
(A());
return 0;
}
Yields the following error using g++:
In function `int main()':
syntax error before `;' token
It seems to me, the compiler considers (A()) to be a cast rather than a
constructor? Does this g++ "misbehaviour" conform to the C++ standard
or is this a bug in g++?
thanks in advance,
Stoyan.