]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: add name hints to c_parser_declspecs [PR107583]
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 16 Jun 2023 00:56:41 +0000 (20:56 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Fri, 16 Jun 2023 00:56:41 +0000 (20:56 -0400)
commit57446d1bc9757ee1fb030600d38fa9487231f2a4
tree3504face4ffa1b943315f0e527181c65796b1d5a
parent7ff793415f55fa9a92f348fecb8c75ac8acc8b87
c: add name hints to c_parser_declspecs [PR107583]

PR c/107583 notes that we weren't issuing a hint for

  struct foo {
    time_t mytime; /* missing <time.h> include should trigger fixit */
  };

in the C frontend.

The root cause is that one of the "unknown type name" diagnostics
was missing logic to emit hints, which this patch fixes.

gcc/c/ChangeLog:
PR c/107583
* c-parser.cc (c_parser_declspecs): Add hints to "unknown type
name" error.

gcc/testsuite/ChangeLog:
PR c/107583
* c-c++-common/spellcheck-pr107583.c: New test.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/c/c-parser.cc
gcc/testsuite/c-c++-common/spellcheck-pr107583.c [new file with mode: 0644]