https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101465
Bug ID: 101465 Summary: Poorly worded error from a call to a pointer-to-member function not wrapped in parentheses Product: gcc Version: 11.1.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: josephcsible at gmail dot com Target Milestone: --- Consider this C++ code: struct foo *x; void (foo::*myfuncptr)(); void f() { x->*myfuncptr(); } This fails to compile, as it should. The problem is that the error I get says I "must use '.*' or '->*' to call pointer-to-member function", even though I'm already using '->*'. The actual change I need to make is to add parentheses, like this: "(x->*myfuncptr)();" We should make the error say this instead.