llvm-capstone/clang/test/SemaTemplate/function-pointer-qualifier.cpp
Lei Liu 413f3c5595 [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
2018-05-03 01:43:23 +00:00

30 lines
438 B
C++

// 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);
}