public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: gcc-patches@gcc.gnu.org
Subject: add more C++ name hints
Date: Fri, 5 Aug 2022 21:35:33 +0200	[thread overview]
Message-ID: <CAP3s5k_2uk-SSPEbZ=Gy_Ri3eAjw8RQH6Nk4fvEDcBYn6fbyEQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

How about adding a few more names from the std namespace to get appropriate
hints?  This patch compiles and the appropriate messages are printed.  Is
there a problem with just adding more or even at some point all the symbols
of the standard library?

gcc/ChangeLog:

        * cp/name-lookup.cc (get_std_name_hint): Add more symbols from the
        <iomanip>, <ios>, <istream> and <ostream> headers.

[-- Attachment #2: d-g++-std-io-syms-hints --]
[-- Type: application/octet-stream, Size: 2509 bytes --]

diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
index ce622761a1a..e77065b83b7 100644
--- a/gcc/cp/name-lookup.cc
+++ b/gcc/cp/name-lookup.cc
@@ -6771,6 +6771,43 @@ get_std_name_hint (const char *name)
     {"future", "<future>", cxx11},
     {"packaged_task", "<future>", cxx11},
     {"promise", "<future>", cxx11},
+    /* <iomanip>.  */
+    {"resetiosflags", "<iomanip>", cxx98},
+    {"setiosflags", "<iomanip>", cxx98},
+    {"setbase", "<iomanip>", cxx98},
+    {"setfill", "<iomanip>", cxx98},
+    {"setprecision", "<iomanip>", cxx98},
+    {"setw", "<iomanip>", cxx98},
+    {"get_money", "<iomanip>", cxx11},
+    {"put_money", "<iomanip>", cxx11},
+    {"get_time", "<iomanip>", cxx11},
+    {"put_time", "<iomanip>", cxx11},
+    {"quoted", "<iomanip>", cxx14},
+    /* <ios>.  */
+    {"boolalpha", "<ios>", cxx98},
+    {"noboolalpha", "<ios>", cxx98},
+    {"showbase", "<ios>", cxx98},
+    {"noshowbase", "<ios>", cxx98},
+    {"showpoint", "<ios>", cxx98},
+    {"noshowpoint", "<ios>", cxx98},
+    {"showpos", "<ios>", cxx98},
+    {"noshowpos", "<ios>", cxx98},
+    {"skipws", "<ios>", cxx98},
+    {"noskipws", "<ios>", cxx98},
+    {"uppercase", "<ios>", cxx98},
+    {"nouppercase", "<ios>", cxx98},
+    {"unitbuf", "<ios>", cxx98},
+    {"nounitbuf", "<ios>", cxx98},
+    {"internal", "<ios>", cxx98},
+    {"left", "<ios>", cxx98},
+    {"right", "<ios>", cxx98},
+    {"dec", "<ios>", cxx98},
+    {"hex", "<ios>", cxx98},
+    {"oct", "<ios>", cxx98},
+    {"fixed", "<ios>", cxx98},
+    {"scientific", "<ios>", cxx98},
+    {"hexfloat", "<ios>", cxx11},
+    {"defaultfloat", "<ios>", cxx11},
     /* <iostream>.  */
     {"cin", "<iostream>", cxx98},
     {"cout", "<iostream>", cxx98},
@@ -6781,6 +6818,7 @@ get_std_name_hint (const char *name)
     {"wclog", "<iostream>", cxx98},
     /* <istream>.  */
     {"istream", "<istream>", cxx98},
+    {"ws", "<istream>", cxx98},
     /* <iterator>.  */
     {"advance", "<iterator>", cxx98},
     {"back_inserter", "<iterator>", cxx98},
@@ -6800,6 +6838,12 @@ get_std_name_hint (const char *name)
     {"reverse_iterator", "<iterator>", cxx98},
     /* <ostream>.  */
     {"ostream", "<ostream>", cxx98},
+    {"ends", "<ostream>", cxx98},
+    {"flush", "<ostream>", cxx98},
+    {"endl", "<ostream>", cxx98},
+    {"emit_on_flush", "<ostream>", cxx20},
+    {"noemit_on_flush", "<ostream>", cxx20},
+    {"flush_emit", "<ostream>", cxx20},
     /* <list>.  */
     {"list", "<list>", cxx98},
     /* <map>.  */

             reply	other threads:[~2022-08-05 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 19:35 Ulrich Drepper [this message]
2022-08-17 10:29 ` Ulrich Drepper
2022-08-17 12:17 ` Marek Polacek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP3s5k_2uk-SSPEbZ=Gy_Ri3eAjw8RQH6Nk4fvEDcBYn6fbyEQ@mail.gmail.com' \
    --to=drepper@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).