From 98b879af5bfb50123a668dc1de6dd86feb9991c5 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Wed, 27 Feb 2013 22:10:37 +0000 Subject: [PATCH] Add test coverage for array to pointer decay in non-type template parameters. Functionality committed in r172585 but tested the function case without the array case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176215 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/SemaTemplate/temp_arg_nontype.cpp | 11 +++++------ 1 file 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 struct PR10766 { static int *ip; }; template int* PR10766::ip = &I; namespace rdar13000548 { - template - 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 + 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::f(); // expected-note{{in instantiation of}} + f(); // expected-note{{in instantiation of}} + f(); // expected-note{{in instantiation of}} } } -- 2.40.0