Lines Matching refs:Base

3 struct Base { };
4 struct Derived : Base { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
6 struct Derived2 : Base { };
10 operator Base&() const;
27 operator Base() const;
46 void bind_lvalue_to_lvalue(Base b, Derived d,
47 const Base bc, const Derived dc,
51 Base &br1 = b;
52 Base &br2 = d;
54 Derived &dr2 = b; // expected-error{{non-const lvalue reference to type 'Derived' cannot bind to a value of unrelated type 'Base'}}
55 Base &br3 = bc; // expected-error{{drops qualifiers}}
56 Base &br4 = dc; // expected-error{{drops qualifiers}}
57 Base &br5 = diamond; // expected-error{{ambiguous conversion from derived class 'Diamond' to base class 'Base':}}
62 void bind_lvalue_quals(volatile Base b, volatile Derived d,
63 volatile const Base bvc, volatile const Derived dvc,
65 volatile Base &bvr1 = b;
66 volatile Base &bvr2 = d;
67 volatile Base &bvr3 = bvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Base' drops qualifiers}}
68 volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Derived' drops qualifiers}}
72 const volatile Base &bcvr1 = b;
73 const volatile Base &bcvr2 = d;
77 Base &br1 = Base(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Base'}}
78 Base &br2 = Derived(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Derived'}}
79 const volatile Base &br3 = Base(); // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a temporary of type 'Base'}}
80 const volatile Base &br4 = Derived(); // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a temporary of type 'Derived'}}
86 Base &br1 = ur; // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a value of unrelated type 'Unrelated'}}
87 const volatile Base &br2 = ur; // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a value of unrelated type 'Unrelated'}}
92 Base &nbr1 = ConvertibleToBaseRef();
93 Base &nbr2 = ConvertibleToDerivedRef();
100 Base &br1 = both; // expected-error{{reference initialization of type 'Base &' with initializer of type 'ConvertibleToBothDerivedRef' is ambiguous}}
114 const Base &br1 = create<Base>();
115 const Base &br2 = create<Derived>();
116 const Derived &dr1 = create<Base>(); // expected-error{{no viable conversion}}
118 const Base &br3 = create<const Base>();
119 const Base &br4 = create<const Derived>();
121 const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Base' drops qualifiers}}
122 const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Derived' drops qualifiers}}
129 const Base &br1 = ConvertibleToBase();
130 const Base &br2 = ConvertibleToDerived();
134 const Base &br1 = both; // expected-error{{reference initialization of type 'const Base &' with initializer of type 'ConvertibleToBothDerived' is ambiguous}}