[HP aCC 3.73] error 187 on an explicit call to a template conversion operator
-----------------------------------------------------------------------------

                 Key: STDCXX-656
                 URL: https://issues.apache.org/jira/browse/STDCXX-656
             Project: C++ Standard Library
          Issue Type: Bug
          Components: External
         Environment: HP aCC 3.26 through 3.73
            Reporter: Martin Sebor


Moved from Rogue Wave bug tracking database:

****Created By: sebor @ Dec 28, 2000 07:27:54 PM****
Subject: aCC 3.26 can't reference a member template operator
Date: Thu, 28 Dec 2000 19:27:36 -0700
From: Martin Sebor <[EMAIL PROTECTED]>
Organization: Rogue Wave Software, Inc.
To: HP aCC mailing list <[EMAIL PROTECTED]>

Hi,

this is also failing to compile (in case Perennial doesn't expose it).

Regards
Martin


$ cat t.cpp
template <class T>
struct B { };

template<class T>
struct A
{
   template <class U>
   operator B<U>();
};

void foo ()
{
   A<int>().operator B<char>();
}

$ aCC -V -c t.cpp
aCC: HP ANSI C++ B3910B A.03.26
Error 187: "t.cpp", line 15 # Referenced object 'operator B<char>' is not a
   member of struct A<int> ["t.cpp", line 5].
       A<int>().operator B<char>();
                ^^^^^^^^^^^^^^^^
****Modified By: sebor @ Dec 29, 2000 11:55:23 AM****
Subject: Re: aCC 3.26 can't reference a member template operator
Date: Thu, 28 Dec 2000 21:53:11 -0800 (PST)
From: Dennis Handly <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]

>This is also failing to compile (in case Perennial doesn't expose it).
Martin

This looks like the error in P26137.C.
CR JAGad01438
P51 P26137.C Error 187 on use of member template conversion operator

I'll add your test in case the extra B<U> is different than just operator U.
****Modified By: sebor @ Dec 29, 2000 04:40:33 PM****
Subject: Re: aCC 3.26 can't reference a member template operator
Date: Fri, 29 Dec 2000 16:40:17 -0700
From: Martin Sebor <[EMAIL PROTECTED]>
Organization: Rogue Wave Software, Inc.
To: Dennis Handly <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
References: 1

Dennis Handly wrote:
...
> I'll add your test in case the extra B<U> is different than just operator U.


Here's another testcase. This one gives a different error. In case you're
wondering, these are showing up as I'm trying to fix (amd test) our auto_ptr.

Martin


$ cat t.cpp
template <class>
struct B;

template <class T>
struct A
{
   template <class U>
   A (const B<U>&);
};

template <class T>
struct B
{
   B ();
   B (const A<T>&);
   
   template <class U>
   operator A<U>();
};

int main ()
{
   B<void> b;
   A<int> a = A<int>(b);
}


$ aCC -AA -V -c t.cpp
aCC: HP ANSI C++ B3910B A.03.26
Error 225: "t.cpp", line 24 # Ambiguous overloaded function call; more than
   one acceptable function found. Two such functions that matched were
   "B<void>::operator A<int><int>()" ["t.cpp", line 18] and
   "A<int>::A<void>(const B<void> &)" ["t.cpp", line 8].
       A<int> a = A<int>(b);
                         ^
****Modified By: sebor @ Jan 04, 2001 11:43:42 AM****
Subject: Re: aCC 3.26 can't reference a member template operator
Date: Thu, 4 Jan 2001 02:25:20 -0800 (PST)
From: Dennis Handly <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]

>Here's another testcase. This one gives a different error. In case you're
>wondering, these are showing up as I'm trying to fix (and test) our auto_ptr.
Martin

At one time there was a discussion about this error with auto_ptr but
I don't think we filed any bugs.  The problem seemed to be related on
what was a "viable" cantidate.

Error 225: line 24 # Ambiguous overloaded function call; more than
   one acceptable function found. Two such functions that matched were
   "B<void>::operator A<int><int>()" [line 18] and
   "A<int>::A<void>(const B<void> &)" [line 8].
       A<int> a = A<int>(b);
                         ^

Here it looks like you don't want the user defined conversion?
Or are both of them user defined?

I assume you know you can change:
  A<int> a = A<int>(b);
to:
  A<int> a(b);

to get that to work?

But if you really wanted to to:
  (A<int>)b;
You get the same errors.

I filed the following bug report for you:
CR JAGad44417
Error 225 overloading on member functions, ctor vs conversion operator
****Modified By: sebor @ Jan 28, 2003 12:16:02 PM****
Still fails with 3.39.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to