summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/temp_arg_nontype.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-06 10:23:53 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-06 10:23:53 +0000
commit645cf44cc34371c808743e5e7c19bb41ff593ca0 (patch)
treea6aac211a6ef7f6b01b6b6b4484b27e4075d0769 /test/SemaTemplate/temp_arg_nontype.cpp
parentb372f51166bdf7e2951ef4820941ec3523086865 (diff)
downloadclang-645cf44cc34371c808743e5e7c19bb41ff593ca0.tar.gz
clang-645cf44cc34371c808743e5e7c19bb41ff593ca0.tar.bz2
clang-645cf44cc34371c808743e5e7c19bb41ff593ca0.tar.xz
Use a substituted type when determining how to substitute in non-type template
params. Don't insert addrof operations when matching against a pointer; array/function conversions should take care of this for us, assuming the argument type-checked in the first place. Add a fixme where we seem to be using a less-restrictive reference type than we should. Fixes PR 6249. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/temp_arg_nontype.cpp')
-rw-r--r--test/SemaTemplate/temp_arg_nontype.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaTemplate/temp_arg_nontype.cpp b/test/SemaTemplate/temp_arg_nontype.cpp
index 497bc6daf8..fdfd4e47b2 100644
--- a/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/test/SemaTemplate/temp_arg_nontype.cpp
@@ -161,3 +161,13 @@ struct X1 {
void test_X0_X1() {
X0<X1::pfunc> x01;
}
+
+// PR6249
+namespace pr6249 {
+ template<typename T, T (*func)()> T f() {
+ return func();
+ }
+
+ int h();
+ template int f<int, h>();
+}