Issue Details (XML | Word | Printable)

Key: STDCXX-743
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[HP aCC 3.77] bogus error #440 on valid code

Created: 09/Mar/08 11:16 PM   Updated: 10/Mar/08 07:28 PM
Return to search
Component/s: External
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
$ uname -sr && aCC -V
HP-UX B.11.31
aCC: HP ANSI C++ B3910B A.03.77
Issue Links:
Dependants
 

Severity: Incorrect Behavior


 Description  « Hide
The code below distilled from a test case submitted in this post fails to compile with HP aCC 3.77 and prior versions but compiles successfully with gcc 4.1.2 and EDG eccp 3.9.
$ cat t.cpp && aCC -V -c t.cpp
template <class T> struct B0 { };
template <class T> struct B1: B0<T> { };
template <class T> struct D: B1<T> { };

template <class T> struct X {
    T* p;
    X () { }
    template <class U> X (const X<U> &p) : p (p.p) { }
};

X<volatile D<int> >  x0;
X<volatile B1<int> > x1 (x0);
aCC: HP ANSI C++ B3910B A.03.77
Error 440: "t.cpp", line 8 # Cannot initialize 'volatile B1<int> *' with
    'volatile D<int> *const'.
        template <class U> X (const X<U> &p) : p (p.p) { }
                                                  ^^^
Error 445: "t.cpp", line 1 # Cannot recover from earlier errors.
    template <class T> struct B0 { };
    ^^^^^^^^^^^^^^^^^^^^^^^^^^


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor made changes - 09/Mar/08 11:17 PM
Field Original Value New Value
Link This issue blocks STDCXX-615 [ STDCXX-615 ]
Martin Sebor added a comment - 10/Mar/08 07:28 PM
HP says "this works fine with A.03.80 with the option +hpxstd98." I've confirmed that aCC 3.77 also accepts the option and successfully compiles the code.

We might want to consider using the option.