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

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