PLEASE REPLY TO [EMAIL PROTECTED] ONLY, *NOT* [EMAIL PROTECTED] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3471
------- Additional Comments From austern at apple dot com 2003-09-09 18:00 ------- I believe that this resolution is incorrect. f.test(b) initializes a reference of type const foo& with a temporary, where the temporary was created via a user-defined conversion from bar, foo::foo(bar). The last bullet item in section 8.5.3/p5 of the standard (i.e. the bullet item just before par 6) says that the temporary is created "using the rules for a non- reference copy initialization (8.5)". 8.5p14 says that non-reference copy initialization is done as if by doing a user-defined conversion and then making a copy. It says that an implementation is permitted to elide the copy constructor, referring to clause 12.2 for details. 12.2 paragraph 1 makes it clear that even when the copy constructor is elided, the implementation is still required to check it for accessibility. I've opened new bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12226 for the failure to check copy constructor accessibility when the copy constructor is optimized away.