public inbox for gcc-cvs-wwwdocs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@sourceware.org>
To: gcc-cvs-wwwdocs@gcc.gnu.org
Subject: gcc-wwwdocs branch master updated. 6ffdf53463831ec99b718151314e225c747a32d1
Date: Thu,  5 Oct 2023 09:08:25 +0000 (GMT)	[thread overview]
Message-ID: <20231005090825.14E3C385802F@sourceware.org> (raw)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gcc-wwwdocs".

The branch, master has been updated
       via  6ffdf53463831ec99b718151314e225c747a32d1 (commit)
      from  50c5c9f94be7b26a2853f64909fa61ebf60086aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6ffdf53463831ec99b718151314e225c747a32d1
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 3 14:57:34 2023 +0100

    Add ADL to C++ non-bugs
    
    Also move the item about C++98 'export' to the end, and update the item
    about <: digraphs that only applies to C++98.

diff --git a/htdocs/bugs/index.html b/htdocs/bugs/index.html
index 813b78c0..41edc561 100644
--- a/htdocs/bugs/index.html
+++ b/htdocs/bugs/index.html
@@ -539,15 +539,15 @@ for details.
 <h2 id="nonbugs_cxx">C++</h2>
 
 <dl>
-<dt><code>export</code></dt>
-<dd><p>Most C++ compilers (G++ included) never implemented C++98
-<code>export</code>, which was removed in C++11, and the keyword reused in
-C++20 by the Modules feature. The C++98 feature was intended to support
-separate compilation of template declarations and
-definitions. Without <code>export</code>, a template definition must be in
-scope to be used. The obvious workaround is simply to place all definitions in
-the header itself. Alternatively, the compilation unit containing template
-definitions may be included from the header.</p></dd>
+<dt>Functions can be called without qualifying them with their namespace.</dt>
+<dd>
+Argument Dependent Lookup (ADL) means that functions can be found in namespaces
+associated with their arguments. This means that <code>move(arg)</code> can
+call <code>std::move</code> if <code>arg</code> is a type defined in namespace
+<code>std</code>, such as <code>std::string</code> or <code>std::vector</code>.
+If <code>std::move</code> is not the function you intended to call, use a
+qualified name such as <code>::move(arg)</code> or <code>foo::move(arg)</code>.
+</dd>
 
 <dt>Nested classes can access private members and types of the containing
 class.</dt>
@@ -597,9 +597,9 @@ handler and catch it in the main thread.</p></dd>
 <dd><p>If you have a class in the global namespace, say named <code>X</code>,
 and want to give it as a template argument to some other class, say
 <code>std::vector</code>, then <code>std::vector&lt;::X&gt;</code>
-fails with a parser error.</p>
+fails with a parser error in C++98/C++03 mode.</p>
 
-<p>The reason is that the standard mandates that the sequence
+<p>The reason is that the C++98 standard mandates that the sequence
 <code>&lt;:</code> is treated as if it were the token <code>[</code>.
 (There are several such combinations of characters - they are called
 <em>digraphs</em>.) Depending on the version, the compiler then reports
@@ -608,7 +608,19 @@ a parse error before the character <code>:</code> (the colon before
 
 <p>The simplest way to avoid this is to write <code>std::vector&lt;
 ::X&gt;</code>, i.e. place a space between the opening angle bracket
-and the scope operator.</p></dd>
+and the scope operator, or compile using C++11 or later. Defect report 1104
+changed the parser rules so that <code>&lt;::</code> works as expected.
+</p></dd>
+
+<dt><code>export</code></dt>
+<dd><p>Most C++ compilers (G++ included) never implemented C++98
+<code>export</code>, which was removed in C++11, and the keyword reused in
+C++20 by the Modules feature. The C++98 feature was intended to support
+separate compilation of template declarations and
+definitions. Without <code>export</code>, a template definition must be in
+scope to be used. The obvious workaround is simply to place all definitions in
+the header itself. Alternatively, the compilation unit containing template
+definitions may be included from the header.</p></dd>
 </dl>
 
 <h3 id="upgrading">Common problems when upgrading the compiler</h3>

-----------------------------------------------------------------------

Summary of changes:
 htdocs/bugs/index.html | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
gcc-wwwdocs

                 reply	other threads:[~2023-10-05  9:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20231005090825.14E3C385802F@sourceware.org \
    --to=redi@sourceware.org \
    --cc=gcc-cvs-wwwdocs@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).