// RUN: %clang_cc1 -fsyntax-only -verify %s // expected-no-diagnostics template struct A { }; constexpr A a; constexpr A b; constexpr int* x = nullptr; constexpr short* y = nullptr; namespace ExplicitArgs { template constexpr int f(U) noexcept(noexcept(T())) { return 0; } template constexpr int f(T*) noexcept { return 1; } template<> constexpr int f(int*) noexcept { return 2; } static_assert(f(1) == 0); static_assert(f(y) == 1); static_assert(f(x) == 2); template constexpr int g(U*) noexcept(noexcept(T())) { return 3; } template constexpr int g(T) noexcept { return 4; } template<> constexpr int g(int*) noexcept { return 5; } static_assert(g(y) == 3); static_assert(g(1) == 4); static_assert(g(x) == 5); } // namespace ExplicitArgs namespace DeducedArgs { template constexpr int f(T, A) noexcept(B) { return 0; } template constexpr int f(T*, A) noexcept(B && B) { return 1; } template<> constexpr int f(int*, A) { return 2; } static_assert(f(x, a) == 0); static_assert(f(y, a) == 1); static_assert(f(x, a) == 2); } // namespace DeducedArgs