public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51433] New: constexpr caching leads to incorrect dynamic initialization
@ 2011-12-06  5:19 richard-gccbugzilla at metafoo dot co.uk
  2012-01-07 22:36 ` [Bug c++/51433] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2011-12-06  5:19 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51433
           Summary: constexpr caching leads to incorrect dynamic
                    initialization
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: richard-gccbugzilla@metafoo.co.uk


Testcase:

constexpr int f();
constexpr int g() { return f(); }
extern const int n = g();
constexpr int f() { return 42; }
extern const int m = g();

g++ uses dynamic initialization for both m and n. Static initialization is
required to be used for m. We can upgrade this to a rejects-valid:

int arr[m]; // error!


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

end of thread, other threads:[~2012-01-10 14:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-06  5:19 [Bug c++/51433] New: constexpr caching leads to incorrect dynamic initialization richard-gccbugzilla at metafoo dot co.uk
2012-01-07 22:36 ` [Bug c++/51433] " pinskia at gcc dot gnu.org
2012-01-10 14:38 ` jason at gcc dot gnu.org
2012-01-10 14:39 ` jason at gcc dot gnu.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).