From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2142) id B0E5D3858D20; Sat, 28 Jan 2023 11:14:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0E5D3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1674904443; bh=Afx2PsZH5YYrTHkU2M1+dGBlDmXGMY+90E1x/poXlTo=; h=To:Subject:Date:From:From; b=q1c/1UC7+NlIwfp7WV6Hq6JY/x4nF6W+eXMq+tWTEp/49D4lfj9HHjE2qggf39RAl /3xTYD+tipUxvOKhAsRc2er9kbLersW93jkewUhZAP+4SDahMOyqnmmSuwJb01TQ4b jJzniw7ReK2glkG/GDRieNSns3ifziVTKk4JhIDU= To: gcc-cvs-wwwdocs@gcc.gnu.org Subject: gcc-wwwdocs branch master updated. acc0159fd3172fd2279bb53b58c4afa4a3fceb40 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 257cb0db2fdc3e56b76e9ca9b2bd19e71d079227 X-Git-Newrev: acc0159fd3172fd2279bb53b58c4afa4a3fceb40 Message-Id: <20230128111403.B0E5D3858D20@sourceware.org> Date: Sat, 28 Jan 2023 11:14:03 +0000 (GMT) From: Gerald Pfeifer List-Id: 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 acc0159fd3172fd2279bb53b58c4afa4a3fceb40 (commit) from 257cb0db2fdc3e56b76e9ca9b2bd19e71d079227 (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 acc0159fd3172fd2279bb53b58c4afa4a3fceb40 Author: Gerald Pfeifer Date: Sat Jan 28 12:11:23 2023 +0100 faq: Remove "Copy constructor access check" entry This entry refers to changes in GCC 3.4 and GCC 4.3 which were released in 2004 and 2008, respectively, and this is hardly a FAQ any more. diff --git a/htdocs/bugs/index.html b/htdocs/bugs/index.html index aaef8915..96a5d0f0 100644 --- a/htdocs/bugs/index.html +++ b/htdocs/bugs/index.html @@ -605,56 +605,6 @@ a parse error before the character : (the colon before

The simplest way to avoid this is to write std::vector< ::X>, i.e. place a space between the opening angle bracket and the scope operator.

- - -
Copy constructor access check while initializing a -reference.
- -

Consider this code:

- -
-class A 
-{
-public:
-  A();
-
-private:
-  A(const A&);   // private copy ctor
-};
-
-A makeA(void);
-void foo(const A&);
-
-void bar(void)
-{
-  foo(A());       // error, copy ctor is not accessible
-  foo(makeA());   // error, copy ctor is not accessible
-
-  A a1;
-  foo(a1);        // OK, a1 is a lvalue
-}
- -

Starting with GCC 3.4.0, binding an rvalue to a const reference requires -an accessible copy constructor. This might be surprising at first sight, -especially since most popular compilers do not correctly implement this -rule.

- -

The C++ Standard says that a temporary object should be created in -this context and its contents filled with a copy of the object we are -trying to bind to the reference; it also says that the temporary copy -can be elided, but the semantic constraints (eg. accessibility) of the -copy constructor still have to be checked.

- -

For further information, you can consult the following paragraphs of -the C++ standard: [dcl.init.ref]/5, bullet 2, sub-bullet 1, and -[class.temporary]/2.

- -

Starting with GCC 4.3.0, GCC no longer gives an error for this -case. This change is based on the -intent -of the C++ language committee. As of 2010-05-28, the final -proposed draft of the C++0x standard permits this code without error.

-

Common problems when upgrading the compiler

----------------------------------------------------------------------- Summary of changes: htdocs/bugs/index.html | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) hooks/post-receive -- gcc-wwwdocs