Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 45484 invoked from network); 1 Sep 2006 15:40:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Sep 2006 15:40:45 -0000 Received: (qmail 73376 invoked by uid 500); 1 Sep 2006 15:40:45 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 73363 invoked by uid 500); 1 Sep 2006 15:40:45 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 73352 invoked by uid 99); 1 Sep 2006 15:40:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2006 08:40:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Sep 2006 08:40:44 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 50E9A7142F3 for ; Fri, 1 Sep 2006 15:37:22 +0000 (GMT) Message-ID: <32659942.1157125042313.JavaMail.jira@brutus> Date: Fri, 1 Sep 2006 08:37:22 -0700 (PDT) From: "Martin Sebor (JIRA)" To: stdcxx-dev@incubator.apache.org Subject: [jira] Created: (STDCXX-282) [MSVC 8.0] bogus ambiguity on overloaded template conversion operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [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 operator T& () { return (T&)x; } template operator T () const { return static_cast(*const_cast(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: '' : 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