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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
@ 2012-01-31 21:27 ` pinskia at gcc dot gnu.org
  2012-02-01  2:33 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-31 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-31 20:04:05 UTC ---
>    vc = (C2(C1(x = y)));

I don't know what the C++ standard says but GCC is parsing this as a function
declaration. 

Comeau C++ online parses it as a constructor.


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

* [Bug c++/52071] Constructor invocation confused
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-01  2:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-01 02:33:15 UTC ---
*** Bug 52077 has been marked as a duplicate of this bug. ***


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

* [Bug c++/52071] Constructor invocation confused
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-02  0:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-02-02
         Depends on|                            |38313
     Ever Confirmed|0                           |1

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-02 00:47:53 UTC ---
Confirmed.  Related to PR 38313.


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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-03 23:53 UTC (permalink / raw)
  To: gcc-bugs

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

Bug 52071 depends on bug 38313, which changed state.

Bug 38313 Summary: g++ fails to parse a member function with a parenthesized type name as its declarator
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38313

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED


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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-04  0:16 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed by the patch which fixed PR38313. I'm adding the testcase and closing the
bug.


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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-04  0:30 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|38313                       |29234

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
As a matter of fact the fix for PR29234 did it.


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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-11-04  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Mon Nov  4 00:42:09 2013
New Revision: 204343

URL: http://gcc.gnu.org/viewcvs?rev=204343&root=gcc&view=rev
Log:
2013-11-03  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/52071
    * g++.dg/parse/pr52071.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/parse/pr52071.C
Modified:
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/52071] Constructor invocation confused
  2012-01-31 21:21 [Bug c++/52071] New: Constructor invocation confused jyates at us dot ibm.com
                   ` (6 preceding siblings ...)
  2013-11-04  0:44 ` paolo at gcc dot gnu.org
@ 2013-11-04  0:44 ` paolo.carlini at oracle dot com
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-04  0:44 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org
   Target Milestone|---                         |4.9.0

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


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