blob: 06fa4828f42f98ba760ec6c551bfcd2858c326b5 [file] [log] [blame]
Richard Smith25923272017-08-25 01:47:55 +00001// RUN: %clang_cc1 -std=c++2a %s -verify
2
3struct X {
4 void ref() & {}
5 void cref() const& {}
6};
7
8void test() {
9 X{}.ref(); // expected-error{{cannot initialize object parameter of type 'X' with an expression of type 'X'}}
10 X{}.cref(); // expected-no-error
11
12 (X{}.*&X::ref)(); // expected-error{{pointer-to-member function type 'void (X::*)() &' can only be called on an lvalue}}
13 (X{}.*&X::cref)(); // expected-no-error
14}