1 // RUN: %clang_cc1 -std=c++2a %s -verify
4 void ref() & {} // expected-note{{'ref' declared here}}
6 void cvref() const volatile & {} // expected-note{{'cvref' declared here}}
10 X
{}.ref(); // expected-error{{'this' argument to member function 'ref' is an rvalue, but function has non-const lvalue ref-qualifier}}
11 X
{}.cref(); // expected-no-error
12 X
{}.cvref(); // expected-error{{'this' argument to member function 'cvref' is an rvalue, but function has non-const lvalue ref-qualifier}}
14 (X
{}.*&X::ref
)(); // expected-error-re{{pointer-to-member function type 'void (X::*)() {{.*}}&' can only be called on an lvalue}}
15 (X
{}.*&X::cref
)(); // expected-no-error
16 (X
{}.*&X::cvref
)(); // expected-error-re{{pointer-to-member function type 'void (X::*)() {{.*}}&' can only be called on an lvalue}}