https://godbolt.org/z/WY54brjqY
struct A {
static constexpr int VALUE = 42;
template <int ARG>
constexpr int bar() const {
return ARG;
}
constexpr int foo() const {
return this->template bar<this->VALUE>();
}
};
static_assert(A{}.foo()==42);
This code compiles with every version of GCC I tried, but I cannot get it to compile with clang at all.