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

--- Comment #2 from Hubert Tong <hstong at ca dot ibm.com> ---
(In reply to Paolo Carlini from comment #1)
> Not having spent a lot of time on this, I doubt it's a bug: the latest clang
> and icc behave exactly like gcc.

I had a vague recollection why I found the code weird to begin with.
After consideration, I found that the MSVC behaviour made sense after all.

There is wording in 12.3 [class.conv]:
At most one user-defined conversion (constructor or conversion function) is
implicitly applied to a single value.

To poke some holes in the applicability of the above wording, I will modify the
test case:
@@ -3,7 +3,8 @@ struct A {
    A();
    A(const A &, bool = 0);
    A(const A &, short = 0);
-   A(B &);
+
+   template <typename T> explicit A(T &);
 };

 struct B : A { };

Note that explicit constructors are not converting constructors.

The modified version of the test case works fine with clang++ and icc, but not
GCC. MSVC chokes on the "explicit".

Reply via email to