// RUN: %clang_cc1 -std=c++17 -verify %s namespace pr41427 { template class A { public: A(void (*)(T)) {} }; void D(int) {} void f() { A a(&D); using T = decltype(a); using T = A; } } namespace Access { struct B { protected: struct type {}; }; template struct D : B { // expected-note {{not viable}} D(T, typename T::type); // expected-note {{private member}} }; D b = {B(), {}}; class X { using type = int; }; D x = {X(), {}}; // expected-error {{no viable constructor or deduction guide}} // Once we implement proper support for dependent nested name specifiers in // friends, this should still work. class Y { template friend D::D(T, typename T::type); // expected-warning {{dependent nested name specifier}} struct type {}; }; D y = {Y(), {}}; class Z { template friend class D; struct type {}; }; D z = {Z(), {}}; } namespace GH69987 { template struct X {}; template struct X; X x; template struct Y { Y(T); }; template struct Y ; Y y(1); }