https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98149

            Bug ID: 98149
           Summary: missing spelling hint for misspelled calls to member
                    functions
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

GCC prints a helpful spelling hint for a call to a namespace-scope function
with a misspelled name but it doesn't do the same for member functions.  It
would be nice if it id.

$ cat t.C && gcc -O2 -S -Wall t.C

struct A {
  static void foobar ();
};

namespace B {
  void foobar ();
}

void f ()
{
  foob ();

  A::foob ();

  B::foob ();
}
t.C: In function ‘void f()’:
t.C:13:3: error: ‘foob’ was not declared in this scope; did you mean ‘foobar’?
   13 |   foob ();
      |   ^~~~
      |   foobar
t.C:15:6: error: ‘foob’ is not a member of ‘A’
   15 |   A::foob ();
      |      ^~~~
t.C:17:6: error: ‘foob’ is not a member of ‘B’; did you mean ‘foobar’?
   17 |   B::foob ();
      |      ^~~~
      |      foobar

Reply via email to