https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96884
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We give an error when you actually call f in an instance of V: 96884.C: In instantiation of ‘void V<T>::f() [with T = int]’: 96884.C:14:9: required from here 96884.C:7:16: error: request for member ‘a’ in ‘(V<int>*)this’, which is of pointer type ‘V<int>*’ (maybe you meant to use ‘->’ ?) 7 | this.a = 0; | ~~~~~^ which is OK.