public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36695]  New: [4.4 Regression] Value-initialization of reference type is allowed.
@ 2008-07-02 12:52 chris dot fairles at gmail dot com
  2008-07-04 21:55 ` [Bug c++/36695] " jsm28 at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: chris dot fairles at gmail dot com @ 2008-07-02 12:52 UTC (permalink / raw)
  To: gcc-bugs

int main() { typedef int& T; T a = T(); }

Compiling the snippet above produces no diagnostic with gcc 4.4.0 20080701 or
gcc 4.1.2. However, reading n2691, 8.5 paragraph 6:

A program that calls for default-initialization or value-initialization of an
entity of reference type is ill-formed.

I'm pretty sure there's a similar statement in the current std.

Comeau seems to issue a diagnostic for the same snippet:
"ComeauTest.c", line 1: error: invalid type conversion
  int main() { typedef int& T; T a = T(); }


-- 
           Summary: [4.4 Regression] Value-initialization of reference type
                    is allowed.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: chris dot fairles at gmail dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2009-06-04 11:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-02 12:52 [Bug c++/36695] New: [4.4 Regression] Value-initialization of reference type is allowed chris dot fairles at gmail dot com
2008-07-04 21:55 ` [Bug c++/36695] " jsm28 at gcc dot gnu dot org
2008-12-27 22:29 ` [Bug c++/36695] [4.3/4.4 Regression] " pinskia at gcc dot gnu dot org
2008-12-28  6:49 ` pinskia at gcc dot gnu dot org
2008-12-29 21:55 ` rguenth at gcc dot gnu dot org
2008-12-30  3:28 ` pinskia at gcc dot gnu dot org
2008-12-30  9:52 ` jakub at gcc dot gnu dot org
2008-12-31  1:42 ` pinskia at gcc dot gnu dot org
2009-01-10 11:48 ` jakub at gcc dot gnu dot org
2009-01-10 11:51 ` [Bug c++/36695] [4.3 " jakub at gcc dot gnu dot org
2009-01-24 10:25 ` rguenth at gcc dot gnu dot org
2009-04-16 15:43 ` pinskia at gcc dot gnu dot org
2009-06-04 11:35 ` rguenth 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).