// Test without serialization: // RUN: %clang_cc1 -fsyntax-only %s -ast-dump -std=c++17 | FileCheck %s // // Test with serialization: // RUN: %clang_cc1 -std=c++17 -emit-pch -o %t %s // RUN: %clang_cc1 -x c++ -std=c++17 -include-pch %t -ast-dump-all /dev/null \ // RUN: | sed -e "s/ //" -e "s/ imported//" \ // RUN: | FileCheck %s namespace PR46111 { template struct S; template struct HasDeductionGuide { typedef PR46111::S STy; HasDeductionGuide(typename STy::Child); }; // This causes deduction guides to be generated for all constructors. HasDeductionGuide()->HasDeductionGuide; template struct HasDeductionGuideTypeAlias { using STy = PR46111::S; HasDeductionGuideTypeAlias(typename STy::Child); }; // This causes deduction guides to be generated for all constructors. HasDeductionGuideTypeAlias()->HasDeductionGuideTypeAlias; // The parameter to this one shouldn't be an elaborated type. // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (typename STy::Child) -> HasDeductionGuide' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (HasDeductionGuide) -> HasDeductionGuide' // CHECK: CXXDeductionGuideDecl {{.*}} 'auto () -> HasDeductionGuide' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (typename STy::Child) -> HasDeductionGuideTypeAlias' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (HasDeductionGuideTypeAlias) -> HasDeductionGuideTypeAlias' // CHECK: CXXDeductionGuideDecl {{.*}} 'auto () -> HasDeductionGuideTypeAlias' } // namespace PR46111 namespace PR48177 { template struct Base { using type_alias = A; }; template struct Derived : Base { using type_alias = typename Derived::type_alias; Derived(Derived &&, typename Derived::type_alias const&); Derived(T); }; template Derived(T, A) -> Derived; void init() { Derived d {1,2}; } } // namespace PR48177 // CHECK: CXXRecordDecl {{.*}} struct Derived // CHECK: TypeAliasDecl {{.*}} type_alias 'typename Derived::type_alias' // CHECK-NEXT: DependentNameType {{.*}} 'typename Derived::type_alias' dependent // CHECK: CXXRecordDecl {{.*}} struct Derived // CHECK: TypeAliasDecl {{.*}} type_alias 'typename Derived::type_alias':'int' // CHECK-NEXT: ElaboratedType {{.*}} 'typename Derived::type_alias' sugar // CHECK-NEXT: TypedefType {{.*}} 'PR48177::Base::type_alias' sugar // CHECK-NEXT: TypeAlias {{.*}} 'type_alias' // CHECK-NEXT: SubstTemplateTypeParmType {{.*}} 'int' sugar // CHECK-NEXT: TemplateTypeParmType {{.*}} 'A' // CHECK-NEXT: TemplateTypeParm {{.*}} 'A' // CHECK-NEXT: BuiltinType {{.*}} 'int' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (Derived &&, const typename Derived::type_alias &) -> Derived' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (T) -> Derived' // CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (Derived) -> Derived' // CHECK: CXXDeductionGuideDecl {{.*}} 'auto (T, A) -> Derived' // CHECK: CXXDeductionGuideDecl {{.*}} 'auto (int, int) -> Derived'