Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-743

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: External
    • Labels:
      None
    • Environment:

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

    • Severity:
      Incorrect Behavior

      Description

      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 { };
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sebor Martin Sebor
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: