You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2006/01/07 01:18:14 UTC

[jira] Created: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

[aCC 3, 5] extern template inconsistently mangled
-------------------------------------------------

         Key: STDCXX-100
         URL: http://issues.apache.org/jira/browse/STDCXX-100
     Project: STDCXX
        Type: Bug
  Components: External  
    Versions: 4.1.2    
 Environment: HP aCC 3, 5
    Reporter: Martin Sebor
    Priority: Critical


****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
-------- Original Message --------
Subject: aCC 3.52 extern template inconsistently mangled
Date: Mon, 01 Nov 2004 11:49:12 -0700
From: Martin Sebor <se...@roguewave.com>
To: acxx-beta@cup.hp.com

Hi,

I came across this bug after I worked around JAGaf22319:

$ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
-AA -c t.cpp && nm t.o | grep foo
namespace N {

template <class T> struct A { };

}

namespace M {

template <class T, class V>
N::A<T>& foo (N::A<T>&, V);

extern template N::A<char>& foo (N::A<char>&, int);

}

#ifndef extern

int main ()
{
   N::A<char> a;

   M::foo (a, 0);
}

#else

namespace M {

template <class T, class V>
N::A<T>& foo (N::A<T> &a, V) { return a; }

}

#endif
aCC: HP ANSI C++ B3910B A.03.52
foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
foo__1MFRQ2_1N1AXTc_i|          |undef |code   |


FWIW, this is how gcc 3.4 mangles the symbol:
foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01

Martin

-- 
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


[jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-100?page=comments#action_12362019 ] 

Martin Sebor commented on STDCXX-100:
-------------------------------------

-------- Original Message --------
Subject: Re:  aCC 3.52 extern template inconsistently mangled
Date: Mon, 1 Nov 2004 17:57:24 -0800 (PST)
From: Dennis Handly <dh...@cup.hp.com>
To: acxx-beta@cup.hp.com, sebor@roguewave.com

>From: Martin Sebor <se...@roguewave.com>
>I came across this bug after I worked around JAGaf22319:

Extern template is only supported for complete classes.  Not member
functions.

> extern template N::A<char>& foo(N::A<char>&, int);

This isn't valid.
aCC5 is broken the same as aCC3.
aCC6 seems to have the same mangling for -D and not, though.

>FWIW, this is how gcc 3.4 mangles the symbol:
>foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
Martin

There is no connection between g++ and aC++ mangling on PA.


> [aCC 3, 5] extern template inconsistently mangled
> -------------------------------------------------
>
>          Key: STDCXX-100
>          URL: http://issues.apache.org/jira/browse/STDCXX-100
>      Project: STDCXX
>         Type: Bug
>   Components: External
>     Versions: 4.1.2
>  Environment: HP aCC 3, 5
>     Reporter: Martin Sebor
>     Priority: Critical

>
> ****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
> -------- Original Message --------
> Subject: aCC 3.52 extern template inconsistently mangled
> Date: Mon, 01 Nov 2004 11:49:12 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> I came across this bug after I worked around JAGaf22319:
> $ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
> -AA -c t.cpp && nm t.o | grep foo
> namespace N {
> template <class T> struct A { };
> }
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T>&, V);
> extern template N::A<char>& foo (N::A<char>&, int);
> }
> #ifndef extern
> int main ()
> {
>    N::A<char> a;
>    M::foo (a, 0);
> }
> #else
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T> &a, V) { return a; }
> }
> #endif
> aCC: HP ANSI C++ B3910B A.03.52
> foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
> foo__1MFRQ2_1N1AXTc_i|          |undef |code   |
> FWIW, this is how gcc 3.4 mangles the symbol:
> foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> Martin

-- 
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


[jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-100?page=comments#action_12362020 ] 

Martin Sebor commented on STDCXX-100:
-------------------------------------

-------- Original Message --------
Subject: Re: aCC 3.52 extern template inconsistently mangled
Date: Tue, 02 Nov 2004 09:26:34 -0700
From: Martin Sebor <se...@roguewave.com>
To: acxx-beta@cup.hp.com
References: <20...@hpcll183.cup.hp.com>

Dennis Handly wrote:
>>From: Martin Sebor <se...@roguewave.com>
>>I came across this bug after I worked around JAGaf22319:
> 
> 
> Extern template is only supported for complete classes.  Not member
> functions.

I'm not sure what you mean. There are no incomplete classes in
the test case I sent you.

> 
> 
>>extern template N::A<char>& foo(N::A<char>&, int);
> 
> 
> This isn't valid.

You mean the construct is not valid? Why? AFAIK, other compilers
that implement extern template accept it.

> aCC5 is broken the same as aCC3.
> aCC6 seems to have the same mangling for -D and not, though.
> 
> 
>>FWIW, this is how gcc 3.4 mangles the symbol:
>>foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> 
> Martin
> 
> There is no connection between g++ and aC++ mangling on PA.

Doh! I knew that! :)

Martin

> [aCC 3, 5] extern template inconsistently mangled
> -------------------------------------------------
>
>          Key: STDCXX-100
>          URL: http://issues.apache.org/jira/browse/STDCXX-100
>      Project: STDCXX
>         Type: Bug
>   Components: External
>     Versions: 4.1.2
>  Environment: HP aCC 3, 5
>     Reporter: Martin Sebor
>     Priority: Critical

>
> ****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
> -------- Original Message --------
> Subject: aCC 3.52 extern template inconsistently mangled
> Date: Mon, 01 Nov 2004 11:49:12 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> I came across this bug after I worked around JAGaf22319:
> $ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
> -AA -c t.cpp && nm t.o | grep foo
> namespace N {
> template <class T> struct A { };
> }
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T>&, V);
> extern template N::A<char>& foo (N::A<char>&, int);
> }
> #ifndef extern
> int main ()
> {
>    N::A<char> a;
>    M::foo (a, 0);
> }
> #else
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T> &a, V) { return a; }
> }
> #endif
> aCC: HP ANSI C++ B3910B A.03.52
> foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
> foo__1MFRQ2_1N1AXTc_i|          |undef |code   |
> FWIW, this is how gcc 3.4 mangles the symbol:
> foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> Martin

-- 
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


[jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-100?page=comments#action_12362021 ] 

Martin Sebor commented on STDCXX-100:
-------------------------------------

-------- Original Message --------
Subject: Re: aCC 3.52 extern template inconsistently mangled
Date: Wed, 3 Nov 2004 02:11:32 -0800 (PST)
From: Dennis Handly <dh...@cup.hp.com>
To: acxx-beta@cup.hp.com, sebor@roguewave.com

>From: Martin Sebor <se...@roguewave.com>
>Dennis Handly wrote:
>> Extern template is only supported for complete classes.  Not member
>> functions.

>I'm not sure what you mean. There are no incomplete classes in
>the test case I sent you.

(I meant the whole class.)
At our meeting you only asked for the syntax:
   extern template class XXX<...>;

Not for arbitrary members.

>>>extern template N::A<char>& foo(N::A<char>&, int);
>> 
>> This isn't valid.

>You mean the construct is not valid? Why? AFAIK, other compilers
>that implement extern template accept it.
Martin

You didn't ask for it.

There is no need for this syntax.  You should use template explicit
specialization forward to suppress the instantiation.

> [aCC 3, 5] extern template inconsistently mangled
> -------------------------------------------------
>
>          Key: STDCXX-100
>          URL: http://issues.apache.org/jira/browse/STDCXX-100
>      Project: STDCXX
>         Type: Bug
>   Components: External
>     Versions: 4.1.2
>  Environment: HP aCC 3, 5
>     Reporter: Martin Sebor
>     Priority: Critical

>
> ****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
> -------- Original Message --------
> Subject: aCC 3.52 extern template inconsistently mangled
> Date: Mon, 01 Nov 2004 11:49:12 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> I came across this bug after I worked around JAGaf22319:
> $ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
> -AA -c t.cpp && nm t.o | grep foo
> namespace N {
> template <class T> struct A { };
> }
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T>&, V);
> extern template N::A<char>& foo (N::A<char>&, int);
> }
> #ifndef extern
> int main ()
> {
>    N::A<char> a;
>    M::foo (a, 0);
> }
> #else
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T> &a, V) { return a; }
> }
> #endif
> aCC: HP ANSI C++ B3910B A.03.52
> foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
> foo__1MFRQ2_1N1AXTc_i|          |undef |code   |
> FWIW, this is how gcc 3.4 mangles the symbol:
> foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> Martin

-- 
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


[jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-100?page=comments#action_12362022 ] 

Martin Sebor commented on STDCXX-100:
-------------------------------------

-------- Original Message --------
Subject: Re: aCC 3.52 extern template inconsistently mangled
Date: Wed, 03 Nov 2004 10:08:01 -0700
From: Martin Sebor <se...@roguewave.com>
To: Dennis Handly <dh...@cup.hp.com>
CC: acxx-beta@cup.hp.com
References: <20...@hpcll183.cup.hp.com>

Dennis Handly wrote:
>>From: Martin Sebor <se...@roguewave.com>
>>Dennis Handly wrote:
>>
>>>Extern template is only supported for complete classes.  Not member
>>>functions.
> 
> 
>>I'm not sure what you mean. There are no incomplete classes in
>>the test case I sent you.
> 
> 
> (I meant the whole class.)
> At our meeting you only asked for the syntax:
>    extern template class XXX<...>;
> 
> Not for arbitrary members.

The test case does not instantiate any members, either.
It instantiates a non-member function. (Although extern
should work with explicit member instantiation as well.)

> 
> 
>>>>extern template N::A<char>& foo(N::A<char>&, int);
>>>
>>>This isn't valid.
> 
> 
>>You mean the construct is not valid? Why? AFAIK, other compilers
>>that implement extern template accept it.
> 
> Martin
> 
> You didn't ask for it.

I certainly did :) See the attached email.

> 
> There is no need for this syntax.  You should use template explicit
> specialization forward to suppress the instantiation.

If nothing else, it should be compatible with g++ and MSVC.
Besides, the extern template proposal was finally accepted
by the EWG at the Redmond meeting last month. The resolution
allows extern on all explicit instantiations.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1448.pdf

In any case, if this isn't just a bug, could you please
open an enhancement request for me?

Thanks
Martin
----------------------------------------------------------------------
Subject: extern template instantiation syntax
From: Martin Sebor <se...@roguewave.com>
Date: Wed, 30 Oct 2002 16:49:07 -0700
To: acxx-beta@cup.hp.com

Hi,

The "extern template" g++ extension I mentioned during our meeting
is documented here:

http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Template-Instantiation.html#Template%20Instantiation

MSVC exposes a similar extension. It is documented here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_pluslang_Explicit_Instantiation.asp

It would be useful if HP aCC implemented this feature as well.

Regards
Martin

> [aCC 3, 5] extern template inconsistently mangled
> -------------------------------------------------
>
>          Key: STDCXX-100
>          URL: http://issues.apache.org/jira/browse/STDCXX-100
>      Project: STDCXX
>         Type: Bug
>   Components: External
>     Versions: 4.1.2
>  Environment: HP aCC 3, 5
>     Reporter: Martin Sebor
>     Priority: Critical

>
> ****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
> -------- Original Message --------
> Subject: aCC 3.52 extern template inconsistently mangled
> Date: Mon, 01 Nov 2004 11:49:12 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> I came across this bug after I worked around JAGaf22319:
> $ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
> -AA -c t.cpp && nm t.o | grep foo
> namespace N {
> template <class T> struct A { };
> }
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T>&, V);
> extern template N::A<char>& foo (N::A<char>&, int);
> }
> #ifndef extern
> int main ()
> {
>    N::A<char> a;
>    M::foo (a, 0);
> }
> #else
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T> &a, V) { return a; }
> }
> #endif
> aCC: HP ANSI C++ B3910B A.03.52
> foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
> foo__1MFRQ2_1N1AXTc_i|          |undef |code   |
> FWIW, this is how gcc 3.4 mangles the symbol:
> foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> Martin

-- 
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


[jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/STDCXX-100?page=comments#action_12362024 ] 

Martin Sebor commented on STDCXX-100:
-------------------------------------

-------- Original Message --------
Subject: Re: aCC 3.52 extern template inconsistently mangled
Date: Wed, 3 Nov 2004 15:54:13 -0800 (PST)
From: Dennis Handly <dh...@cup.hp.com>
To: sebor@roguewave.com
CC: acxx-beta@cup.hp.com

>From: Martin Sebor <se...@roguewave.com>
>The test case does not instantiate any members, either.
>It instantiates a non-member function.

Since explicit specialization forward can be used for individual functions
we thought the only use for extern template is for extern template class.
And that's all we implemented.

>I certainly did :) See the attached email.

Rat's I still have a copy too.

>If nothing else, it should be compatible with g++ and MSVC.

We are for aCC6.

>In any case, if this isn't just a bug, could you please open an
>enhancement request for me?
Martin

Ok, but it probably won't be done for PA.  CR JAGaf45746:
Implement extern template for non-classes, bad mangling

> [aCC 3, 5] extern template inconsistently mangled
> -------------------------------------------------
>
>          Key: STDCXX-100
>          URL: http://issues.apache.org/jira/browse/STDCXX-100
>      Project: STDCXX
>         Type: Bug
>   Components: External
>     Versions: 4.1.2
>  Environment: HP aCC 3, 5
>     Reporter: Martin Sebor
>     Priority: Critical

>
> ****Created By: sebor @ Nov 01, 2004 03:00:09 PM****
> -------- Original Message --------
> Subject: aCC 3.52 extern template inconsistently mangled
> Date: Mon, 01 Nov 2004 11:49:12 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> I came across this bug after I worked around JAGaf22319:
> $ cat t.cpp && aCC -Dextern="" -V -c t.cpp && nm t.o | grep foo && aCC
> -AA -c t.cpp && nm t.o | grep foo
> namespace N {
> template <class T> struct A { };
> }
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T>&, V);
> extern template N::A<char>& foo (N::A<char>&, int);
> }
> #ifndef extern
> int main ()
> {
>    N::A<char> a;
>    M::foo (a, 0);
> }
> #else
> namespace M {
> template <class T, class V>
> N::A<T>& foo (N::A<T> &a, V) { return a; }
> }
> #endif
> aCC: HP ANSI C++ B3910B A.03.52
> foo__1MXTcTi_FRQ2_1N1AXTc_i|         0|extern|entry  |$CODE$
> foo__1MFRQ2_1N1AXTc_i|          |undef |code   |
> FWIW, this is how gcc 3.4 mangles the symbol:
> foo__H2ZcZi_1MRQ21Nt1A1ZX01X11_RQ21Nt1A1ZX01
> Martin

-- 
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