aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-05-24 00:44:22 +0200
committerMark Wielaard <mark@klomp.org>2020-06-04 01:22:53 +0200
commit1dc83b460653c29f96b4659579e2151fae0d1e6e (patch)
tree946ec0b018766ecb4f0e8c005c8e4dc3ac81d04a /gcc/c
parent9eea5d2ddf73037e21b59bcd8084ba969ae10174 (diff)
downloadgcc-1dc83b460653c29f96b4659579e2151fae0d1e6e.zip
gcc-1dc83b460653c29f96b4659579e2151fae0d1e6e.tar.gz
gcc-1dc83b460653c29f96b4659579e2151fae0d1e6e.tar.bz2
Provide diagnostic hints for missing C++ cinttypes string constants.
When reporting an error in cp_parser and we notice a string literal followed by an unknown name check whether there is a known standard header containing a string macro with the same name, then add a hint to the error message to include that header. gcc/c-family/ChangeLog: * known-headers.cc (get_cp_stdlib_header_for_string_macro_name): New function. * known-headers.h (get_cp_stdlib_header_for_string_macro_name): New function declaration. gcc/cp/ChangeLog: * parser.c (cp_lexer_safe_previous_token): New function. (cp_parser_error_1): Add name_hint if the previous token is a string literal and next token is a CPP_NAME and we have a missing header suggestion for the name. gcc/testsuite/ChangeLog: * g++.dg/spellcheck-inttypes.C: Add string-literal testcases.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions