This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14463] [3.4/3.5 Regression] copy constructor access checked when passing reference arg


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]