[Bug c++/48453] [C++0x] Invalid reference initialization via explicit conversion

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Wed Apr 6 06:34:00 GMT 2011


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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-04-06 06:34:20 UTC ---
(In reply to comment #1)

I agree, I just recognize that 13.3.1.6 [over.match.ref] p. 1 b. 1 is written
to support this:

"The conversion functions of S and its base classes are considered, 
except that for copy-initialization, only the non-explicit conversion 
functions are considered. Those that are not hidden within S and yield
type “lvalue reference to cv2 T2” (when 8.5.3 requires an lvalue result) 
or “cv2 T2” or “rvalue reference to cv2 T2” (when 8.5.3 requires an rvalue 
result), where “cv1 T” is reference-compatible (8.5.3) with “cv2 T2”, are 
candidate functions."

IMO the core language should strike the reference to "implicit conversions" in
8.5.3.



More information about the Gcc-bugs mailing list