This patch kit adds various improvements to the suggestions
we offer for missing #include directives, in response to
recent feedback on my blog post.
None of these are regressions, but it's a new user-visible
feature, so would be nice to fix them for the release, and I
believe they're relatively low risk.
David Malcolm (4):
More #include suggestions (PR c++/84269)
C: Ensure that we print include hints in
-Wimplicit-function-declaration
C++: suggest missing headers for implicit use of "std" (PR c++/85021)
C++: more std header hints; filter on C++ dialect (PR c++/84269)
gcc/c-family/known-headers.cc | 33 ++-
gcc/c/c-decl.c | 14 +-
gcc/cp/name-lookup.c | 316 ++++++++++++++++-----
.../g++.dg/lookup/missing-std-include-6.C | 75 +++++
.../g++.dg/lookup/missing-std-include-7.C | 16 ++
.../g++.dg/lookup/missing-std-include-8.C | 44 +++
gcc/testsuite/g++.dg/lookup/missing-std-include.C | 7 +-
gcc/testsuite/g++.dg/spellcheck-reswords.C | 1 +
gcc/testsuite/g++.dg/spellcheck-stdlib.C | 73 +++++
gcc/testsuite/gcc.dg/spellcheck-stdlib-2.c | 38 +++
gcc/testsuite/gcc.dg/spellcheck-stdlib-3.c | 16 ++
gcc/testsuite/gcc.dg/spellcheck-stdlib.c | 50 ++++
12 files changed, 607 insertions(+), 76 deletions(-)
create mode 100644 gcc/testsuite/g++.dg/lookup/missing-std-include-6.C
create mode 100644 gcc/testsuite/g++.dg/lookup/missing-std-include-7.C
create mode 100644 gcc/testsuite/g++.dg/lookup/missing-std-include-8.C
create mode 100644 gcc/testsuite/gcc.dg/spellcheck-stdlib-2.c
create mode 100644 gcc/testsuite/gcc.dg/spellcheck-stdlib-3.c
--
1.8.5.3