stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-100) [aCC 3, 5] extern template inconsistently mangled
Date Sat, 07 Jan 2006 00:24:16 GMT
    [ 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 <sebor@roguewave.com>
To: Dennis Handly <dhandly@cup.hp.com>
CC: acxx-beta@cup.hp.com
References: <200411031011.CAA05103@hpcll183.cup.hp.com>

Dennis Handly wrote:
>>From: Martin Sebor <sebor@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 <sebor@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 <sebor@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


Mime
View raw message