`static constexpr` function called in a constant expression is…an error?
问题 I have the following code: class MyClass { static constexpr bool foo() { return true; } void bar() noexcept(foo()) { } }; I would expect that since foo() is a static constexpr function, and since it's defined before bar is declared, this would be perfectly acceptable. However, g++ gives me the following error: error: ‘static constexpr bool MyClass::foo()’ called in a constant expression This is...less than helpful, since the ability to call a function in a constant expression is the entire