[Bug c++/96884] Missing diagnostics when applying the member operator on this in class template

2020-09-07 Thread anders.granlund.0 at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96884

Anders Granlund  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|UNCONFIRMED |RESOLVED

--- Comment #2 from Anders Granlund  ---
Yes. You are correct this is not a bug. The standard allows both possibilities
in this case.

[Bug c++/96884] Missing diagnostics when applying the member operator on this in class template

2020-09-01 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96884

Marek Polacek  changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek  ---
We give an error when you actually call f in an instance of V:

96884.C: In instantiation of ‘void V::f() [with T = int]’:
96884.C:14:9:   required from here
96884.C:7:16: error: request for member ‘a’ in ‘(V*)this’, which is of
pointer type ‘V*’ (maybe you meant to use ‘->’ ?)
7 |   this.a = 0;
  |   ~^

which is OK.