1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // expected-no-diagnostics
10 constexpr int* x
= nullptr;
11 constexpr short* y
= nullptr;
13 namespace ExplicitArgs
{
14 template<typename T
, typename U
>
15 constexpr int f(U
) noexcept(noexcept(T())) {
20 constexpr int f(T
*) noexcept
{
25 constexpr int f
<int>(int*) noexcept
{
29 static_assert(f
<int>(1) == 0);
30 static_assert(f
<short>(y
) == 1);
31 static_assert(f
<int>(x
) == 2);
33 template<typename T
, typename U
>
34 constexpr int g(U
*) noexcept(noexcept(T())) {
39 constexpr int g(T
) noexcept
{
44 constexpr int g
<int>(int*) noexcept
{
48 static_assert(g
<int>(y
) == 3);
49 static_assert(g
<short>(1) == 4);
50 static_assert(g
<int>(x
) == 5);
51 } // namespace ExplicitArgs
53 namespace DeducedArgs
{
54 template<typename T
, bool B
>
55 constexpr int f(T
, A
<B
>) noexcept(B
) {
59 template<typename T
, bool B
>
60 constexpr int f(T
*, A
<B
>) noexcept(B
&& B
) {
65 constexpr int f(int*, A
<false>) {
69 static_assert(f
<int*>(x
, a
) == 0);
70 static_assert(f
<short>(y
, a
) == 1);
71 static_assert(f
<int>(x
, a
) == 2);
72 } // namespace DeducedArgs