public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55240] New: [c++0x] ICE on non-static data member initialization using 'auto' variable from containing function
@ 2012-11-08 14:34 bisqwit at iki dot fi
  2012-11-08 14:49 ` [Bug c++/55240] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bisqwit at iki dot fi @ 2012-11-08 14:34 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55240
           Summary: [c++0x] ICE on non-static data member initialization
                    using 'auto' variable from containing function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bisqwit@iki.fi


This code causes an ICE in GCC 4.7.1 and 4.7.2:

int main()
{
    int q = 1;
    struct test { int x = q; } instance;
}

tmpq.cc: In constructor 'constexpr main()::test::test()':
tmpq.cc:4:12: internal compiler error: in expand_expr_real_1, at expr.c:9122

It is notable that if the code is written like this, the error message changes.

int main()
{
    int q = 1;
    struct test { int x; test():x(q){} } instance;
}

tmpq.cc:5:35: error: use of 'auto' variable from containing function
tmpq.cc:3:9: error:   'int q' declared here


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

end of thread, other threads:[~2013-05-05 12:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-08 14:34 [Bug c++/55240] New: [c++0x] ICE on non-static data member initialization using 'auto' variable from containing function bisqwit at iki dot fi
2012-11-08 14:49 ` [Bug c++/55240] " redi at gcc dot gnu.org
2012-11-08 21:34 ` daniel.kruegler at googlemail dot com
2013-02-15 19:33 ` jason at gcc dot gnu.org
2013-03-17  2:35 ` jason at gcc dot gnu.org
2013-04-01 21:06 ` jason at gcc dot gnu.org
2013-05-05 12:09 ` 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).