https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91792

            Bug ID: 91792
           Summary: [9 Regression] constexpr ++ or -- evaluation fails on
                    float or double
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cyp561 at gmail dot com
  Target Milestone: ---

According to https://godbolt.org/z/XzT1wz, compiles in 8.3 and trunk. Fails
compilation on 9.2.

constexpr float f() { float x = 42; ++x; return x; }
void g() { constexpr float x = f(); }

<source>: In function 'void g()':
<source>:2:33:   in 'constexpr' expansion of 'f()'
<source>:2:34: error: '((float)1 + 4.2e+1f)' is not a constant expression
    2 | void g() { constexpr float x = f(); }
      |                                  ^

Reply via email to