// RUN: %clang_cc1 -std=c++2a %s -verify

struct X {
  void ref() & {}
  void cref() const& {}
};

void test() {
  X{}.ref(); // expected-error{{cannot initialize object parameter of type 'X' with an expression of type 'X'}}
  X{}.cref(); // expected-no-error

  (X{}.*&X::ref)(); // expected-error{{pointer-to-member function type 'void (X::*)() &' can only be called on an lvalue}}
  (X{}.*&X::cref)(); // expected-no-error
}

// RUN: %clang_cc1 -std=c++2a %s -verify

struct X {
  void ref() & {}
  void cref() const& {}
};

void test() {
  X{}.ref(); // expected-error{{cannot initialize object parameter of type 'X' with an expression of type 'X'}}
  X{}.cref(); // expected-no-error

  (X{}.*&X::ref)(); // expected-error-re{{pointer-to-member function type 'void (X::*)() {{.*}}&' can only be called on an lvalue}}
  (X{}.*&X::cref)(); // expected-no-error
}

Fix MSVC bots which include '__attribute__((thiscall))' in pretty-printed member function types.
Fix MSVC bots which include '__attribute__((thiscall))' in pretty-printed member function types.

We really shouldn't be including inferred calling conventions here, but let's get the bots green first...


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@311746 91177308-0d34-0410-b5e6-96231b3b80d8
