Having:
struct Value
{
template
static constexpr T value{0};
};
(0) ideone
te
This is definitely a gcc and clang bug in their treatment of variable templates as dependent names. I submitted gcc 67248 and clang 24473.
As a workaround for now, both compilers support the old way of doing variable templates, namely if you added:
struct Value
{
template
static constexpr T value = 0;
template
struct variable_template_ish {
static constexpr T value = Value::value;
};
};
then the following compiles:
template
struct Something
{
void foo() {
static_assert(TValue::template variable_template_ish::value == 0, "");
}
};
int main() {
Something{}.foo();
}