|
| 1 | +class excluded_base { |
| 2 | +public: |
| 3 | + /// This function should be shadowed by derived classes. |
| 4 | + excluded_base& derived_shadowed(); |
| 5 | + /// This function should be shadowed by the base class. |
| 6 | + excluded_base& base_shadowed(); |
| 7 | + /// This function should be inherited by derived classes. |
| 8 | + excluded_base& excluded_inherited(); |
| 9 | +protected: |
| 10 | + /// This function should be shadowed by derived classes. |
| 11 | + excluded_base& do_shadowed(); |
| 12 | + /// This function should be shadowed by the base class. |
| 13 | + excluded_base& do_base_shadowed(); |
| 14 | + /// This function should be inherited by derived classes. |
| 15 | + excluded_base& do_excluded_inherited(); |
| 16 | +}; |
| 17 | + |
| 18 | +class base_base { |
| 19 | +public: |
| 20 | + /// This function should be indirectly inherited by derived classes. |
| 21 | + base_base& base_base_inherited(); |
| 22 | +public: |
| 23 | + /// This function should be indirectly inherited by derived classes. |
| 24 | + base_base& do_base_base_inherited(); |
| 25 | +}; |
| 26 | + |
| 27 | +class base : |
| 28 | + public base_base |
| 29 | +{ |
| 30 | +public: |
| 31 | + /// This function should be shadowed by derived classes. |
| 32 | + base& derived_shadowed(); |
| 33 | + /// This function should shadow the excluded_base function. |
| 34 | + base& base_shadowed(); |
| 35 | + /// This function should be inherited by derived classes. |
| 36 | + base& base_inherited(); |
| 37 | +protected: |
| 38 | + /// This function should be shadowed by derived classes. |
| 39 | + base& do_derived_shadowed(); |
| 40 | + /// This function should shadow the excluded_base function. |
| 41 | + base& do_base_shadowed(); |
| 42 | + /// This function should be inherited by derived classes. |
| 43 | + base& do_base_inherited(); |
| 44 | +}; |
| 45 | + |
| 46 | +class derived |
| 47 | + : public base |
| 48 | + , public excluded_base |
| 49 | +{ |
| 50 | +public: |
| 51 | + /// This function should shadow the base class function. |
| 52 | + derived& derived_shadowed(); |
| 53 | +public: |
| 54 | + /// This function should shadow the base class function. |
| 55 | + derived& do_derived_shadowed(); |
| 56 | +}; |
| 57 | + |
| 58 | +/// Should inherit functions as protected. |
| 59 | +class protected_derived |
| 60 | + : protected base |
| 61 | + , protected excluded_base |
| 62 | +{ |
| 63 | +public: |
| 64 | + /// This function should shadow the base class function. |
| 65 | + protected_derived& derived_shadowed(); |
| 66 | +public: |
| 67 | + /// This function should shadow the base class function. |
| 68 | + protected_derived& do_derived_shadowed(); |
| 69 | +}; |
| 70 | + |
| 71 | +class private_derived |
| 72 | + : private base |
| 73 | + , private excluded_base |
| 74 | +{ |
| 75 | +public: |
| 76 | + /// This function should shadow the base class function. |
| 77 | + private_derived& derived_shadowed(); |
| 78 | +public: |
| 79 | + /// This function should shadow the base class function. |
| 80 | + private_derived& do_derived_shadowed(); |
| 81 | +}; |
0 commit comments