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

* [Bug c++/51433] constexpr caching leads to incorrect dynamic initialization
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-01-07 22:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-07
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-01-07 22:36:18 UTC ---
Confirmed.


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

* [Bug c++/51433] constexpr caching leads to incorrect dynamic initialization
  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
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-10 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-10 14:37:30 UTC ---
Author: jason
Date: Tue Jan 10 14:37:26 2012
New Revision: 183065

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183065
Log:
    PR c++/51433
    * semantics.c (cxx_eval_call_expression): Always retry previously
    non-constant expressions.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-cache1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/51433] constexpr caching leads to incorrect dynamic initialization
  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
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2012-01-10 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2012-01-10 14:39:03 UTC ---
Fixed for 4.7.


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