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

            Bug ID: 127636
           Summary: Incorrect constant evaluation result on x86 32-bit
                    platforms
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: de34 at live dot cn
  Target Milestone: ---

GCC currently rejects the following code snippet on 32-bit i386 platforms,
while accepts it on other platforms. https://godbolt.org/z/cqf3qoWYM

It seems that GCC basically behaves wrong on x86 32-bit. 

```
constexpr auto n = static_cast<long>(365.2425 * 60 * 60 * 24);
static_assert(n == 31556952);
```

Reply via email to