diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-14 21:23:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-14 21:23:13 +0000 |
commit | d3d08533116b4ad5ff5d29c88a0e136687297058 (patch) | |
tree | 3a1db6002555c7b75852bedc82448afbd89e5710 /test/CXX/expr/expr.unary/expr.unary.op | |
parent | 6af27ec69560f7e4b0dac4a0b4341cd6062f6852 (diff) |
Don't consider an overloaded operator& when the expression is actually
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146587 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/expr/expr.unary/expr.unary.op')
-rw-r--r-- | test/CXX/expr/expr.unary/expr.unary.op/p3.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/CXX/expr/expr.unary/expr.unary.op/p3.cpp b/test/CXX/expr/expr.unary/expr.unary.op/p3.cpp new file mode 100644 index 0000000000..2dd6b23fa0 --- /dev/null +++ b/test/CXX/expr/expr.unary/expr.unary.op/p3.cpp @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -fsyntax-only %s -verify + +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; +} |