public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29039]  New: implicitly defined constructor for class with reference member
@ 2006-09-12 18:52 amylaar at gcc dot gnu dot org
  2006-09-12 19:08 ` [Bug c++/29039] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2006-09-12 18:52 UTC (permalink / raw)
  To: gcc-bugs

The following ill-formed code is accepted:

typedef struct
{
  int &r;
} S;

S
f ()
{
  return S ();
}


12.1 ; 5 states that if there is no user-declared constructor for a class, a
default constructor is implicitly declared. 12.1 ; 7 states that such a
constructor is implicitly defined when it is used to create an object of its
class type, and that it performs the same set of initializations that would be
performed by a user-written default constructor with an empty
mem-initializer-list. 12.6.2 ; 4 says that if an entity not named in a
mem-initializer-id is of reference type, the program is ill-formed.


-- 
           Summary: implicitly defined constructor for class with reference
                    member
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: amylaar at gcc dot gnu dot org


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


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

* [Bug c++/29039] [4.0/4.1/4.2 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
@ 2006-09-12 19:08 ` pinskia at gcc dot gnu dot org
  2006-09-20 22:35 ` mmitchel at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-12 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-09-12 19:08 -------
Even though we give a weird error message in 3.4.0 and before, we rejected the
code:
t.cc: In function `struct S f()':
t.cc:11: no matching function for call to `S::._0 ()'
t.cc:6: candidates are: S::._0(const S &)


Confirmed, a regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.0.0 4.1.0 4.2.0
      Known to work|                            |3.3.3 3.0.4 3.2.3 2.95.3
                   |                            |3.4.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-12 19:08:28
               date|                            |
            Summary|implicitly defined          |[4.0/4.1/4.2 Regression]
                   |constructor for class with  |implicitly defined
                   |reference member            |constructor for class with
                   |                            |reference member
   Target Milestone|---                         |4.0.4


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


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

* [Bug c++/29039] [4.0/4.1/4.2 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
  2006-09-12 19:08 ` [Bug c++/29039] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-09-20 22:35 ` mmitchel at gcc dot gnu dot org
  2006-10-17 22:35 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-09-20 22:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug c++/29039] [4.0/4.1/4.2 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
  2006-09-12 19:08 ` [Bug c++/29039] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
  2006-09-20 22:35 ` mmitchel at gcc dot gnu dot org
@ 2006-10-17 22:35 ` mmitchel at gcc dot gnu dot org
  2006-10-17 22:52 ` [Bug c++/29039] [4.0/4.1 " mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-17 22:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from mmitchel at gcc dot gnu dot org  2006-10-17 22:35 -------
Subject: Bug 29039

Author: mmitchel
Date: Tue Oct 17 22:35:29 2006
New Revision: 117834

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117834
Log:
        PR c++/29039
        * typeck2.c (build_functional_cast): Don't zero-initialize
        non-PODs; instead, call their constructors.
        * method.c (synthesize_method): Always build mem-initializers, if
        we're synthesizing the default constructor.
        PR c++/29039
        * g++.dg/init/ctor8.C: New test.


Added:
    trunk/gcc/testsuite/g++.dg/init/ctor8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/method.c
    trunk/gcc/cp/typeck2.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-10-17 22:35 ` mmitchel at gcc dot gnu dot org
@ 2006-10-17 22:52 ` mmitchel at gcc dot gnu dot org
  2007-02-03 20:04 ` gdr at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-10-17 22:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from mmitchel at gcc dot gnu dot org  2006-10-17 22:52 -------
Fixed in 4.2.0.


-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED
            Summary|[4.0/4.1/4.2 Regression]    |[4.0/4.1 Regression]
                   |implicitly defined          |implicitly defined
                   |constructor for class with  |constructor for class with
                   |reference member            |reference member


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-10-17 22:52 ` [Bug c++/29039] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 20:04 ` gdr at gcc dot gnu dot org
  2007-02-03 21:01 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 20:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2007-02-03 20:04 -------
Won't fix in GCC-4.0.x.  Adjusting milestone.


-- 

gdr at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.4                       |4.1.3


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-02-03 20:04 ` gdr at gcc dot gnu dot org
@ 2007-02-03 21:01 ` pinskia at gcc dot gnu dot org
  2007-02-14  9:17 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-03 21:01 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.3                       |4.1.2


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-02-03 21:01 ` pinskia at gcc dot gnu dot org
@ 2007-02-14  9:17 ` mmitchel at gcc dot gnu dot org
  2008-02-12  6:39 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:17 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-02-14  9:17 ` mmitchel at gcc dot gnu dot org
@ 2008-02-12  6:39 ` jason at gcc dot gnu dot org
  2008-02-12  6:40 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-12  6:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2008-02-12 06:38 -------
Subject: Bug 29039

Author: jason
Date: Tue Feb 12 06:37:34 2008
New Revision: 132254

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132254
Log:
        PR c++/34094
        * decl2.c (cp_write_global_declarations): Don't write out static
        data members with DECL_IN_AGGR_P set.

        PR c++/33916
        * Revert:
        2006-10-17  Mark Mitchell  <mark@codesourcery.com>
        PR c++/29039
        * typeck2.c (build_functional_cast): Don't zero-initialize
        non-PODs; instead, call their constructors.

Removed:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/init/ctor8.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/decl2.c
    branches/gcc-4_2-branch/gcc/cp/typeck2.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/29039] [4.0/4.1 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2008-02-12  6:39 ` jason at gcc dot gnu dot org
@ 2008-02-12  6:40 ` jason at gcc dot gnu dot org
  2008-07-04 21:31 ` [Bug c++/29039] [4.2 " jsm28 at gcc dot gnu dot org
  2009-03-30 17:05 ` jsm28 at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-12  6:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2008-02-12 06:39 -------
I reverted Mark's patch for 4.2.4 because it caused PR 33916.  This bug is
fixed in 4.3.0 by the patch for 33916, which seems too complex to risk
backporting.


-- 


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


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

* [Bug c++/29039] [4.2 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2008-02-12  6:40 ` jason at gcc dot gnu dot org
@ 2008-07-04 21:31 ` jsm28 at gcc dot gnu dot org
  2009-03-30 17:05 ` jsm28 at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 21:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jsm28 at gcc dot gnu dot org  2008-07-04 21:30 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.1/4.2 Regression]        |[4.2 Regression] implicitly
                   |implicitly defined          |defined constructor for
                   |constructor for class with  |class with reference member
                   |reference member            |
   Target Milestone|4.1.3                       |4.2.5


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


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

* [Bug c++/29039] [4.2 Regression] implicitly defined constructor for class with reference member
  2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2008-07-04 21:31 ` [Bug c++/29039] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 17:05 ` jsm28 at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2009-03-30 17:05 -------
Closing 4.2 branch, fixed in 4.3.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to fail|4.0.0 4.0.4 4.1.0 4.1.3     |4.0.0 4.0.4 4.1.0 4.1.3
                   |4.2.4                       |4.2.4 4.2.5
         Resolution|                            |FIXED
   Target Milestone|4.2.5                       |4.3.0


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


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

end of thread, other threads:[~2009-03-30 17:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-12 18:52 [Bug c++/29039] New: implicitly defined constructor for class with reference member amylaar at gcc dot gnu dot org
2006-09-12 19:08 ` [Bug c++/29039] [4.0/4.1/4.2 Regression] " pinskia at gcc dot gnu dot org
2006-09-20 22:35 ` mmitchel at gcc dot gnu dot org
2006-10-17 22:35 ` mmitchel at gcc dot gnu dot org
2006-10-17 22:52 ` [Bug c++/29039] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2007-02-03 20:04 ` gdr at gcc dot gnu dot org
2007-02-03 21:01 ` pinskia at gcc dot gnu dot org
2007-02-14  9:17 ` mmitchel at gcc dot gnu dot org
2008-02-12  6:39 ` jason at gcc dot gnu dot org
2008-02-12  6:40 ` jason at gcc dot gnu dot org
2008-07-04 21:31 ` [Bug c++/29039] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 17:05 ` jsm28 at gcc dot gnu dot 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).