This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/49692] New: Constructor call mistaken for declaration


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]