https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96884
Bug ID: 96884 Summary: Missing diagnostics when applying the member operator on this in class template Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: anders.granlund.0 at gmail dot com Target Milestone: --- Program (main.cpp): template<typename T> class V { int *a; void f() { this.a = 0; } }; int main() { } Compilation command line: g++ -std=c++17 -pedantic-errors main.cpp Observed behaviour: No compilation errors. Expected behaviour: Compilation error about incorrectly trying to use the member operator (.) instead of (->) on the this keyword. Note: clang++ gives the expected error message.