The following code compiles gcc successfully
template<typename T>
class F {
public:
template<typename V>
static void foo(V T::*) {
p<bool> = nullptr;
}
template<typename V>
static inline V T::* p;
};
struct A;
template class F<A>;
int main() {
}
and clang compilation fails with
<source>:10:18: error: member pointer refers into non-class type 'bool'
static inline V T::* p;
^
<source>:6:3: note: in instantiation of static data member 'F::p' requested here
p<bool> = nullptr;
^
is this invalid code or i don't understand clang?