[clang][lex] NFCI: Use DirectoryEntryRef in ModuleMap::inferFrameworkModule()
[llvm-project.git] / clang / test / SemaTemplate / ctad.cpp
blob4d836839d8c34622ae5df68003c3002ec77df2e9
1 // RUN: %clang_cc1 -std=c++17 -verify %s
3 namespace pr41427 {
4 template <typename T> class A {
5 public:
6 A(void (*)(T)) {}
7 };
9 void D(int) {}
11 void f() {
12 A a(&D);
13 using T = decltype(a);
14 using T = A<int>;
18 namespace Access {
19 struct B {
20 protected:
21 struct type {};
23 template<typename T> struct D : B { // expected-note {{not viable}}
24 D(T, typename T::type); // expected-note {{private member}}
26 D b = {B(), {}};
28 class X {
29 using type = int;
31 D x = {X(), {}}; // expected-error {{no viable constructor or deduction guide}}
33 // Once we implement proper support for dependent nested name specifiers in
34 // friends, this should still work.
35 class Y {
36 template <typename T> friend D<T>::D(T, typename T::type); // expected-warning {{dependent nested name specifier}}
37 struct type {};
39 D y = {Y(), {}};
41 class Z {
42 template <typename T> friend class D;
43 struct type {};
45 D z = {Z(), {}};