[Bug c++/12226] [3.3/3.4 Regression] g++ fails to enforce accessibility requirement for copy constructor

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Oct 18 02:55:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12226


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-18 00:46:44
               date|                            |
            Summary|g++ fails to enforce        |[3.3/3.4 Regression] g++
                   |accessibility requirement   |fails to enforce
                   |for copy constructor        |accessibility requirement
                   |                            |for copy constructor
   Target Milestone|---                         |3.4


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-18 00:46 -------
The example in this PR is not a good example.
Here is a better example for PR 12591:
class foo {
        private:
                foo(const foo &);
        public:
                foo();
};
const foo &bar = foo();

Here is the quote from clause 12.2, paragraph 1 which applies (for temporary objects):
"Example: even if the copy constructor is not called, all the semantic restrictions, such as 
accessibility (clause 11), shall be satisfied."
The part that applies is clause 12.2, paragraph 5, the example.
Since 3.3.3 most likely will not exist, setting target to 3.4.
: Search converges between 2002-10-11-trunk (#101) and 2002-10-12-trunk (#102).



More information about the Gcc-bugs mailing list