You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// minimal reproducible example, oversimplified codestructfoo {
staticconstexprboolbar() {
returntrue;
}
template<bool B = bar()> // <-- clang has issue with thisstaticconstexprboolbaz() {
returntrue;
}
};
static_assert(foo::baz(), "");
GCC, MSVC, ICC, and NVC++ all compile this code successfully, but Clang (trunk) produces the following diagnostic output:
<source>:7:23: error: non-type template argument is not a constant expression template<bool B = bar()> // <-- clang has issue with this ^~~~~<source>:7:23: note: undefined function 'bar' cannot be used in a constant expression<source>:3:27: note: declared here static constexpr bool bar() { ^<source>:12:15: error: no matching function for call to 'baz'static_assert(foo::baz(), ""); ^~~~~~~~2 errors generated.Compiler returned: 1