diff options
author | Mark Wielaard <mark@klomp.org> | 2020-05-24 00:44:22 +0200 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:10:04 -0300 |
commit | 69826459e507b31c5bad50bea01ded8d78c99b86 (patch) | |
tree | 33fa79d37bb7238068f6b8bf1a4d1a6dfb1c0cc4 /gcc/cp/constexpr.c | |
parent | 1a85838d60472a6ec459ebb78b13d1036a04ec02 (diff) | |
download | gcc-69826459e507b31c5bad50bea01ded8d78c99b86.zip gcc-69826459e507b31c5bad50bea01ded8d78c99b86.tar.gz gcc-69826459e507b31c5bad50bea01ded8d78c99b86.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/cp/constexpr.c')
0 files changed, 0 insertions, 0 deletions