Closed runner0353 closed 4 years ago
This "issue" where clang complains that an expression is not a constant expression has come up before. Solving it usually involved some workarounds as I was unable to get to the core of the problem. Turns out that clang is (again) more standards-compilant and this behaviour is specified in expr.const#5. Thanks to Richard for his answer here.
constexpr
functions in v0.9.1 which take a const T&
descriptor now take a const T
instead which fixes the issue and is standards-compliant.
I will also be working on better and more rigorous tests which should hopefully prevent this from happening in the future!
clang++ myinheritance.cpp -o myinheritance -std=c++17 In file included from myinheritance.cpp:2: ./../refl.hpp:2231:37: error: static_assert expression is not an integral constant expression static_assert(has_bases(t), "Target type does not have a bases<A, B, ...> attribute.");