public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>
Subject: Re: [committed 03/12] libstdc++: Add macros for the inline namespace std::_V2
Date: Mon, 16 May 2022 17:19:35 +0100	[thread overview]
Message-ID: <CACb0b4kOvaTHX7EpcEhb1nfvw4XKXpRkZxpL_bAt5y5TfsnB-Q@mail.gmail.com> (raw)
In-Reply-To: <005d0911-4fb6-f14a-a23a-2ff26774bfd6@gmail.com>

On Mon, 16 May 2022 at 05:28, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Based on what you told me recently maybe this patch is better. It does
> not change the link errors.

We need to be a little careful about just removing those macros.

For definitions that use qualified names, the macros are not needed.
For example:

namespace std { inline namespace __8 {
  struct foo {
    void bar();  // #1
  };
} }

namespace std {
  void foo::bar() { } // #2
}

The definition at #2 works correctly, because name lookup for 'foo'
finds std::__8::foo, so it's a definition of the member declared at
#1.

But if we have a definition using an unqualified name, that doesn't
work the same. For example:

namespace std { inline namespace __8 {
  void func(); // #3
} }

namespace std {
  void func() { } // #4
}

The definition at #4 doesn't need to do any name lookup, so it just
defines (and declares) a new function directly in namespace std. This
means we have std::__8::func declared at #3 and std::func declared at
#4, and so trying to call std::func() would be ambiguous.

So we don't need to _add_ the macros to files where the symbols are
already being defined correctly (which is why your recent patch was
not needed). And we can remove them from _some_ source files. But if
we remove all source files, some of those removals would be wrong.


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

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-13 12:40 [committed 01/12] libstdc++: Disable Doxygen GROUP_NESTED_COMPOUNDS config option Jonathan Wakely
2022-05-13 12:40 ` [committed 02/12] libstdc++: Fix typo in doxygen @headerfile command Jonathan Wakely
2022-05-13 12:40 ` [committed 03/12] libstdc++: Add macros for the inline namespace std::_V2 Jonathan Wakely
2022-05-14 15:36   ` François Dumont
2022-05-16  4:27     ` François Dumont
2022-05-16 16:19       ` Jonathan Wakely [this message]
2022-05-16 17:04         ` François Dumont
2022-05-16 16:13     ` Jonathan Wakely
2022-05-16 16:59       ` François Dumont
2022-05-13 12:40 ` [committed 04/12] libstdc++: Improve doxygen docs for std::pointer_traits Jonathan Wakely
2022-05-13 12:40 ` [committed 05/12] libstdc++: Improve doxygen docs for <system_error> Jonathan Wakely
2022-05-13 12:40 ` [committed 06/12] libstdc++: Improve doxygen docs for <atomic> Jonathan Wakely
2022-05-13 12:40 ` [committed 07/12] libstdc++: Improve doxygen docs for <regex> Jonathan Wakely
2022-05-13 12:40 ` [committed 08/12] libstdc++: Improve doxygen docs for std::allocator Jonathan Wakely
2022-05-13 12:40 ` [committed 09/12] libstdc++: Improve doxygen docs for algorithms and more Jonathan Wakely
2022-05-13 12:40 ` [committed 10/12] libstdc++: Improve doxygen docs for <thread> and <future> Jonathan Wakely
2022-05-13 12:40 ` [committed 11/12] libstdc++: Improve doxygen docs for some of <memory> Jonathan Wakely
2022-05-13 12:40 ` [committed 12/12] libstdc++: Improve doxygen docs for <mutex> Jonathan Wakely

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=CACb0b4kOvaTHX7EpcEhb1nfvw4XKXpRkZxpL_bAt5y5TfsnB-Q@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=frs.dumont@gmail.com \
    --cc=libstdc++@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).