summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commit15dda3701a09889fe80b63a2411ba4c5bcd90101 (patch)
tree5d6934b6de8f8e80ac5689ac577870b49b644da3 /clang/test
parent4692faa7a485de68783ef5e44fda89eeda004045 (diff)
downloadbcm5719-llvm-15dda3701a09889fe80b63a2411ba4c5bcd90101.tar.gz
bcm5719-llvm-15dda3701a09889fe80b63a2411ba4c5bcd90101.zip
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. llvm-svn: 95495
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaTemplate/temp_arg_nontype.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/temp_arg_nontype.cpp b/clang/test/SemaTemplate/temp_arg_nontype.cpp
index 497bc6daf8a..fdfd4e47b24 100644
--- a/clang/test/SemaTemplate/temp_arg_nontype.cpp
+++ b/clang/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>();
+}
OpenPOWER on IntegriCloud