public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53794] New: [c++11, accepts invalid] dangling reference accepted in nested structures with initializer lists
@ 2012-06-28  9:35 dirkmoermans at gmail dot com
  2012-06-28 13:13 ` [Bug c++/53794] [c++11] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dirkmoermans at gmail dot com @ 2012-06-28  9:35 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53794
           Summary: [c++11, accepts invalid] dangling reference accepted
                    in nested structures with initializer lists
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dirkmoermans@gmail.com


The code below is currently accepted without warning by gcc-4.6.3 and
gcc-4.7.0.

===
struct A
{
   int& i;
};

struct B
{
   A a;
};

int main()
{
   B b1{}; // BUG: accepts invalid
   // B b2; // rejected
};
===

I think it should be rejected, since uninitialized references are not allowed
by the language.


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

end of thread, other threads:[~2015-03-24 13:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-28  9:35 [Bug c++/53794] New: [c++11, accepts invalid] dangling reference accepted in nested structures with initializer lists dirkmoermans at gmail dot com
2012-06-28 13:13 ` [Bug c++/53794] [c++11] " redi at gcc dot gnu.org
2012-06-28 13:19 ` redi at gcc dot gnu.org
2015-03-24 13:58 ` 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).