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/02/21 16:48:30 UTC

[jira] Commented: (STDCXX-150) [HP aCC 3.63] bogus error 643 on template specialization and inheritance

    [ http://issues.apache.org/jira/browse/STDCXX-150?page=comments#action_12367212 ] 

Martin Sebor commented on STDCXX-150:
-------------------------------------

-------- Original Message --------
Subject: RE: aCC 3.63 bogus error 643 on template specialization
Date: Tue, 21 Feb 2006 09:55:24 +0530
From: S G Ganesh <sg...@india.hp.com>
Reply-To: <sg...@india.hp.com>
Organization: HP (ISO)
To: 'Martin Sebor' <se...@roguewave.com>, <ac...@cup.hp.com>


>> > 
>> > $ cat t.cpp && aCC -AA -V -c t.cpp
>> > /*   1 */ template <class T> struct S { static const int i = 0; };
>> > /*   2 */ template <class T> struct S<const T>: S<T> { };
>> > /*   3 */ template <class T> const int S<T>::i;
>> > /*   4 */ template <> struct S<int> { static const int i = 1; };
>> > /*   5 */ const int S<int>::i;
>> > aCC: HP ANSI C++ B3910B A.03.63
>> > Error 643: "t.cpp", line 3 # Template type parameter 'i' 
>> may not be 
>> > redeclared within the scope of the template.
>> >     template <class T> const int S<T>::i;
>> >                        ^^^^^^^^^^^^^^^^^^ 

Martin, I've filed CR JAGaf92048 for this on aCC3. 

Thanks!
-Ganesh 


> [HP aCC 3.63] bogus error 643 on template specialization and inheritance
> ------------------------------------------------------------------------
>
>          Key: STDCXX-150
>          URL: http://issues.apache.org/jira/browse/STDCXX-150
>      Project: C++ Standard Library
>         Type: Bug
>   Components: External
>  Environment: HP aCC 3.63
>     Reporter: Martin Sebor

>
> -------- Original Message --------
> Subject: aCC 3.63 bogus error 643 on template specialization
> Date: Mon, 20 Feb 2006 12:54:09 -0700
> From: Martin Sebor <se...@roguewave.com>
> To: acxx-beta@cup.hp.com
> Hi,
> The program below was reduced from our latest implementation of
> numeric_limits. aCC 3 (but not 6) chokes on it for some strange
> reason. I can't think of a workaround -- do you have any ideas?
> Martin
> $ cat t.cpp && aCC -AA -V -c t.cpp
> /*   1 */ template <class T> struct S { static const int i = 0; };
> /*   2 */ template <class T> struct S<const T>: S<T> { };
> /*   3 */ template <class T> const int S<T>::i;
> /*   4 */ template <> struct S<int> { static const int i = 1; };
> /*   5 */ const int S<int>::i;
> aCC: HP ANSI C++ B3910B A.03.63
> Error 643: "t.cpp", line 3 # Template type parameter 'i' may not be 
> redeclared within the scope of the template.
>     template <class T> const int S<T>::i;
>                        ^^^^^^^^^^^^^^^^^^
> Error 309: "t.cpp", line 3 # Only classes, functions, and static data 
> members may be used as templates.
>     template <class T> const int S<T>::i;
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Error 445: "t.cpp", line 3 # Cannot recover from earlier errors.
>     template <class T> const int S<T>::i;
>     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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