// RUN: %clang_cc1 -fsyntax-only -verify %s
// PR clang/3175
voidbar(int*);classc{int var;staticint svar;voidfoo(){bar(&var);bar(&svar);}staticvoidwibble(){bar(&var);// expected-error{{invalid use of member 'var' in static member function}}
bar(&svar);}};enumE{
Enumerator
};voidtest(){(void)&Enumerator;// expected-error{{cannot take the address of an rvalue of type 'E'}}
}template<int N>voidtest2(){(void)&N;// expected-error{{cannot take the address of an rvalue of type 'int'}}
}// PR clang/3222
voidxpto();void(*xyz)(void)=&xpto;structPR11066{staticintfoo(short);staticintfoo(float);voidtest();};voidPR11066::test(){int(PR11066::*ptr)(int)=&&PR11066::foo;// expected-error{{extra '&' taking address of overloaded function}}
}namespacetest3{// emit no error
template<typename T>structS{virtualvoidf()=0;};template<typename T>voidS<T>::f(){ T::error;}void(S<int>::*p)()=&S<int>::f;}