diff options
-rw-r--r-- | test/SemaTemplate/temp_arg_nontype.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp index 434054ecbd..210b5e463f 100644 --- a/test/SemaTemplate/temp_arg_nontype.cpp +++ b/test/SemaTemplate/temp_arg_nontype.cpp @@ -325,16 +325,15 @@ template <int& I> struct PR10766 { static int *ip; }; 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}} } } |