2011-12-15 05:23:13 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only %s -verify
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2011-12-15 05:23:13 +08:00
|
|
|
|
|
|
|
namespace rdar10544564 {
|
|
|
|
// Check that we don't attempt to use an overloaded operator& when
|
|
|
|
// naming a pointer-to-member.
|
|
|
|
struct X {
|
|
|
|
void** operator & ();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Y
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
X member;
|
|
|
|
X memfunc1();
|
|
|
|
X memfunc2();
|
|
|
|
X memfunc2(int);
|
|
|
|
|
|
|
|
void test() {
|
|
|
|
X Y::*data_mem_ptr = &Y::member;
|
|
|
|
X (Y::*func_mem_ptr1)() = &Y::memfunc1;
|
|
|
|
X (Y::*func_mem_ptr2)() = &Y::memfunc2;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
X Y::*data_mem_ptr = &Y::member;
|
|
|
|
X (Y::*func_mem_ptr1)() = &Y::memfunc1;
|
|
|
|
X (Y::*func_mem_ptr2)() = &Y::memfunc2;
|
|
|
|
}
|