[Bug c++/17673] New: ld: Unsatisfied symbols referencing static const via overloaded operator->

jerrydy at sbcglobal dot net gcc-bugzilla@gcc.gnu.org
Sun Sep 26 04:26:00 GMT 2004


I have test case below that compiles using HP aC++ and VC++ 6.0. This occurs 
only when trying to reference the static const via an overloaded -> operator.

class HandleRep {
public:
        static const int OCI_HTYPE = 100;
};

template <class T>
class shared_ptr {
public:
        T* t;
        T* operator -> () {
                return t;
        };
};

int main() {
        shared_ptr<HandleRep> h;
        int i = h->OCI_HTYPE;
}

-- 
           Summary: ld: Unsatisfied symbols referencing static const via
                    overloaded operator->
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jerrydy at sbcglobal dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17673



More information about the Gcc-bugs mailing list