public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52071] New: Constructor invocation confused
@ 2012-01-31 21:21 jyates at us dot ibm.com
  2012-01-31 21:27 ` [Bug c++/52071] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jyates at us dot ibm.com @ 2012-01-31 21:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52071

             Bug #: 52071
           Summary: Constructor invocation confused
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jyates@us.ibm.com


struct C1 {
    C1(int);
};

struct C2 {
    C2();
    C2(C1);
};

void f()
{
    int x;
    int y = 1;
    C2  vc;

    // No problem
    vc = C2(C1(x = y));

    // local variable 'y' may not appear in this context
    // default arguments are only permitted for function parameters
    vc = (C2(C1(x = y)));

    // No problem
    vc = (C2(C1((0, x = y))));
}


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

end of thread, other threads:[~2013-11-04  0:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
2012-01-31 21:27 ` [Bug c++/52071] " pinskia at gcc dot gnu.org
2012-02-01  2:33 ` pinskia at gcc dot gnu.org
2012-02-02  0:48 ` pinskia at gcc dot gnu.org
2013-11-03 23:53 ` paolo.carlini at oracle dot com
2013-11-04  0:16 ` paolo.carlini at oracle dot com
2013-11-04  0:30 ` paolo.carlini at oracle dot com
2013-11-04  0:44 ` paolo at gcc dot gnu.org
2013-11-04  0:44 ` paolo.carlini at oracle dot com

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).