[ http://issues.apache.org/jira/browse/STDCXX-282?page=comments#action_12432199 ]
Martin Sebor commented on STDCXX-282:
-------------------------------------
Filed here: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=191926
> [MSVC 8.0] bogus ambiguity on overloaded template conversion operator
> ---------------------------------------------------------------------
>
> Key: STDCXX-282
> URL: http://issues.apache.org/jira/browse/STDCXX-282
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Environment: MSVC 7.0, 7.1, 8.0
> Reporter: Martin Sebor
>
> The well-formed program below fails to compile with all recent versions of MSVC, including
8.0:
> $ cat t.cpp && cl t.cpp
> struct S {
> int x;
> template <class T> operator T& () { return (T&)x; }
> template <class T> operator T () const {
> return static_cast<T&>(*const_cast<S*>(this));
> }
> };
> int main ()
> {
> S s = { 0 };
> return int (s);
> }
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
> Copyright (C) Microsoft Corporation. All rights reserved.
> t.cpp
> t.cpp(16) : error C2440: '<function-style-cast>' : cannot convert from 'S' to 'int'
> No user-defined-conversion operator available that can perform this conversion,
or the operator cannot be called
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|