This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14463] [3.4/3.5 Regression] copy constructor access checked when passing reference arg
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2004 15:16:46 -0000
- Subject: [Bug c++/14463] [3.4/3.5 Regression] copy constructor access checked when passing reference arg
- References: <20040306192732.14463.arnej@europe.yahoo-inc.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-03-07 15:16 -------
No: "TestFailure(intp)" is an rvalue ([basic.lval]/6, or [expr.type.conv]/1),
and binding a rvalue to a reference requires the construction of a temporary
([class.temporary]/1). When doing so, a copy constructor might be invoked. The
standard (again at [class.temporary]/1) says that the copy can be elided, but
the semantic restrictions (involving accessibility) must be satisfied. Hence
GCC is correct here.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14463