[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 <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
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