OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [visibility20.C] - Diff between revs 305 and 338

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do assemble  }
// { dg-do assemble  }
// GROUPS passed visibility
// GROUPS passed visibility
// visibility file
// visibility file
// From: doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott)
// From: doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott)
// Date:     Tue, 10 Aug 93 10:06:33 PDT
// Date:     Tue, 10 Aug 93 10:06:33 PDT
// Subject:  G++ 2.4.5 allows access to protected base members
// Subject:  G++ 2.4.5 allows access to protected base members
// Message-ID: <9308101706.AA04485@foxtrot.ccmrc.ucsb.edu>
// Message-ID: <9308101706.AA04485@foxtrot.ccmrc.ucsb.edu>
class Base {
class Base {
protected:
protected:
      void protectedBaseFunction() {} // { dg-error "" } protected
      void protectedBaseFunction() {} // { dg-error "" } protected
public:
public:
    Base() {}
    Base() {}
};
};
class Derived : public Base {
class Derived : public Base {
public:
public:
    Derived() {}
    Derived() {}
    void noticeThisFunction(Base *);
    void noticeThisFunction(Base *);
};
};
void
void
Derived::noticeThisFunction(Base *b) {
Derived::noticeThisFunction(Base *b) {
    b->protectedBaseFunction(); // ARM says this is not allowed// { dg-error "" } .*
    b->protectedBaseFunction(); // ARM says this is not allowed// { dg-error "" } .*
                                // since it is not called on 'this'
                                // since it is not called on 'this'
}
}
int main() {
int main() {
    Base b;
    Base b;
    Derived d;
    Derived d;
    d.noticeThisFunction(&b);
    d.noticeThisFunction(&b);
    printf("gpptest run\n");// { dg-error "" } .*
    printf("gpptest run\n");// { dg-error "" } .*
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.