// // PR c++/65202 // { dg-do compile { target c++14 } } // { dg-additional-options "-Wno-return-type" } template struct is_move_constructible; template struct is_move_assignable; template using enable_if_t = int; namespace adl { template < typename L, typename R, enable_if_t() && is_move_assignable(), int>...> constexpr auto adl_swap(L &l, R &r) -> decltype(swap(l, r)) { return; } template auto swap(L &l, R &r) noexcept(noexcept(adl::adl_swap(l, r))) -> decltype(adl::adl_swap(l, r)); namespace ns { template struct foo {}; template void swap(foo &, foo &); struct bar; int main() { foo f; adl::swap(f, f) // { dg-error "expected ';'" } } // { dg-error "expected '.'" "expected end of namespace" }