Constexpr member function on l-value ref object: Clang and gcc disagree
问题 When a class has a constexpr member function and that member function is being evaluated on an l-value object in a constexpr context, clang and gcc disagree whether the result is a constexpr value. Why? Is there a workaround that needs neither default-constructability nor copy-constructability? When the object is passed by value, both compilers succeed compiling. Clang versions trunk, 8, 7: static_assert expression is not an integral constant expression and Gcc versions trunk, 8.1, 7.4: