The following code compiles fine on gcc 8, but errors out on gcc 9 with "error: requested alignment is not an integer constant": #include <algorithm> #include <cstddef> struct One {}; struct Two {}; static constexpr const size_t ALIGNMENT = std::max(alignof(One), alignof(Two)); struct Foo { alignas(ALIGNMENT) char value; }; This is a minimal reproducer based on mmapper FTBFS from https://bugzilla.redhat.com/show_bug.cgi?id=1675396
Looks like this regressed with r261971. I'll open an upstream PR.
Great, thanks for tracking that down!
Reduced test by Matthew: constexpr unsigned long a(const unsigned long b) { return b; } const unsigned long c = a(alignof(int)); alignas(c) char d;
Fixed for GCC 9.2 and 10. Should be in the next Fedora update.
Awesome, thanks!
This is now fixed in gcc 9.2.1. Thanks!