template <int& I> int* PR10766<I>::ip = &I;
namespace rdar13000548 {
- template<typename R, R F(int)>
- struct X {
- typedef R (*fptype)(int);
- static fptype f() { return &F; } // expected-error{{cannot take the address of an rvalue of type 'int (*)(int)'}}
- };
+ template<typename R, typename U, R F>
+ U f() { return &F; } // expected-error{{cannot take the address of an rvalue of type 'int (*)(int)'}} expected-error{{cannot take the address of an rvalue of type 'int *'}}
int g(int);
+ int y[3];
void test()
{
- X<int, g>::f(); // expected-note{{in instantiation of}}
+ f<int(int), int (*)(int), g>(); // expected-note{{in instantiation of}}
+ f<int[3], int*, y>(); // expected-note{{in instantiation of}}
}
}