This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49692] New: Constructor call mistaken for declaration
- From: "kortink at inter dot nl.net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 9 Jul 2011 21:10:14 +0000
- Subject: [Bug c++/49692] New: Constructor call mistaken for declaration
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49692
Summary: Constructor call mistaken for declaration
Product: gcc
Version: 4.6.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: kortink@inter.nl.net
The compiler interprets
MyObject(variable_name)
as
MyObject variable_name
If variable_name exists as an int, this causes a 'redeclaration' error instead
of a call to the constructor MyObject::MyObject(int).
Am I missing some syntactic aspect here ? The root cause may very well be that
e.g.
int (variable_name)
is accepted by the compiler as a declaration. It doesn't look like one to me.