I reduced my problem to the following:
struct A { static constexpr std::size_t f() { return 4; } }; template<std::size_t N> struct B : A { alignas(A::f()) char a[N]; };
I do not see what is wrong with this, but if I try to compile using g++ :
main.cpp:9:19: error: expression 'A::f' is not a constant-expression alignas(A::f()) char a[N]; ^ main.cpp:9: confused by earlier errors, bailing out
Playback is available on coliru .
source share