Index: clang/lib/Sema/SemaTemplate.cpp =================================================================== --- clang/lib/Sema/SemaTemplate.cpp +++ clang/lib/Sema/SemaTemplate.cpp @@ -1958,6 +1958,10 @@ TLB, TL.getTypedefNameDecl()->getTypeSourceInfo()->getTypeLoc()); } + + QualType TransformElaboratedType(TypeLocBuilder &TLB, ElaboratedTypeLoc TL) { + return TransformType(TLB, TL.getNamedTypeLoc()); + } }; /// Transform to convert portions of a constructor declaration into the Index: clang/test/AST/deduction-guides.cpp =================================================================== --- /dev/null +++ clang/test/AST/deduction-guides.cpp @@ -0,0 +1,20 @@ +// RUN: %clang_cc1 -fsyntax-only %s -ast-dump -std=c++17 | 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; + +// The parameter to this one shouldn't be an elaborated type. +// CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (typename S::Child) -> HasDeductionGuide' +// CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto (HasDeductionGuide) -> HasDeductionGuide' +// CHECK: CXXDeductionGuideDecl {{.*}} implicit 'auto () -> HasDeductionGuide' +} // namespace PR46111