xref: /llvm-project/clang/test/CXX/expr/expr.unary/expr.unary.op/p3.cpp (revision c6e68daac0fa6e77a89f3ca72f266a528503dd1c)
172341032SDouglas Gregor // RUN: %clang_cc1 -fsyntax-only %s -verify
2*c6e68daaSAndy Gibbs // expected-no-diagnostics
372341032SDouglas Gregor 
472341032SDouglas Gregor namespace rdar10544564 {
572341032SDouglas Gregor   // Check that we don't attempt to use an overloaded operator& when
672341032SDouglas Gregor   // naming a pointer-to-member.
772341032SDouglas Gregor   struct X {
872341032SDouglas Gregor     void** operator & ();
972341032SDouglas Gregor   };
1072341032SDouglas Gregor 
1172341032SDouglas Gregor   struct Y
1272341032SDouglas Gregor   {
1372341032SDouglas Gregor   public:
1472341032SDouglas Gregor     X member;
1572341032SDouglas Gregor     X memfunc1();
1672341032SDouglas Gregor     X memfunc2();
1772341032SDouglas Gregor     X memfunc2(int);
1872341032SDouglas Gregor 
testrdar10544564::Y1972341032SDouglas Gregor     void test() {
2072341032SDouglas Gregor       X Y::*data_mem_ptr = &Y::member;
2172341032SDouglas Gregor       X (Y::*func_mem_ptr1)() = &Y::memfunc1;
2272341032SDouglas Gregor       X (Y::*func_mem_ptr2)() = &Y::memfunc2;
2372341032SDouglas Gregor     }
2472341032SDouglas Gregor   };
2572341032SDouglas Gregor 
2672341032SDouglas Gregor   X Y::*data_mem_ptr = &Y::member;
2772341032SDouglas Gregor   X (Y::*func_mem_ptr1)() = &Y::memfunc1;
2872341032SDouglas Gregor   X (Y::*func_mem_ptr2)() = &Y::memfunc2;
2972341032SDouglas Gregor }
30