summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaTemplate/function-pointer-qualifier.cpp
diff options
context:
space:
mode:
authorLei Liu <lei.liu2@windriver.com>2018-05-03 01:43:23 +0000
committerLei Liu <lei.liu2@windriver.com>2018-05-03 01:43:23 +0000
commit413f3c55955537552b556a556d678d5756a9f16b (patch)
tree92e419afe91e967fb8859cc8e9f2c56520ee6535 /clang/test/SemaTemplate/function-pointer-qualifier.cpp
parent87f1343a73fa56729571fb93deeb4f795d3e042b (diff)
downloadbcm5719-llvm-413f3c55955537552b556a556d678d5756a9f16b.tar.gz
bcm5719-llvm-413f3c55955537552b556a556d678d5756a9f16b.zip
[Sema] Do not match function type with const T in template argument deduction
From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584, function type should not match cv-qualified type in template argument deduction. This also matches what GCC and EDG do in template argument deduction. Differential Revision: https://reviews.llvm.org/D45755 llvm-svn: 331424
Diffstat (limited to 'clang/test/SemaTemplate/function-pointer-qualifier.cpp')
-rw-r--r--clang/test/SemaTemplate/function-pointer-qualifier.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/function-pointer-qualifier.cpp b/clang/test/SemaTemplate/function-pointer-qualifier.cpp
new file mode 100644
index 00000000000..97d160738a2
--- /dev/null
+++ b/clang/test/SemaTemplate/function-pointer-qualifier.cpp
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+template<class _Ty> inline
+ void testparam(_Ty **, _Ty **)
+ {
+ }
+
+template<class _Ty> inline
+ void testparam(_Ty *const *, _Ty **)
+ {
+ }
+
+template<class _Ty> inline
+ void testparam(_Ty **, const _Ty **)
+ {
+ }
+
+template<class _Ty> inline
+ void testparam(_Ty *const *, const _Ty **)
+ {
+ }
+
+void case0()
+{
+ void (**p1)();
+ void (**p2)();
+ testparam(p1, p2);
+}
OpenPOWER on IntegriCloud