public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/49692] New: Constructor call mistaken for declaration
@ 2011-07-09 21:10 kortink at inter dot nl.net
  2011-07-09 21:39 ` [Bug c++/49692] " schwab@linux-m68k.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kortink at inter dot nl.net @ 2011-07-09 21:10 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-10  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-09 21:10 [Bug c++/49692] New: Constructor call mistaken for declaration kortink at inter dot nl.net
2011-07-09 21:39 ` [Bug c++/49692] " schwab@linux-m68k.org
2011-07-09 23:08 ` kortink at inter dot nl.net
2011-07-10  4:30 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).