// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s struct Y { int x; }; template struct X1 { int f(T* ptr, int T::*pm) { // expected-error{{member pointer}} return ptr->*pm; } }; template struct X1; template struct X1; // expected-note{{instantiation}} template struct X2 { T f(Class &obj, T Class::*pm) { // expected-error{{to a reference}} \ // expected-error{{member pointer to void}} return obj.*pm; } }; template struct X2; template struct X2; // expected-note{{instantiation}} template struct X2; // expected-note{{instantiation}} template struct X3 { X3 &operator=(const T& value) { return *this; } }; X3 x3; typedef int Y::*IntMember; template struct X4 { X3 member; int &getMember(Y& y) { return y.*Member; } }; int &get_X4(X4<&Y::x> x4, Y& y) { return x4.getMember(y); } template void accept_X4(X4); void test_accept_X4(X4<&Y::x> x4) { accept_X4(x4); } namespace ValueDepMemberPointer { template struct instantiate_function {}; template struct S { static void instantiate(); typedef instantiate_function<&S::instantiate> x; // expected-note{{instantiation}} }; template void S::instantiate() { int a[(int)sizeof(T)-42]; // expected-error{{array with a negative size}} } S s; } namespace PR18192 { struct A { struct { int n; }; }; template struct X {}; constexpr int A::*p = &A::n; X

x; // expected-error{{not a pointer to member constant}} }