diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 07a1a4195427d..a5da6c9c88328 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -810,7 +810,7 @@ Bug Fixes to C++ Support module imports in those situations. (#GH60336) - Fix init-capture packs having a size of one before being instantiated. (#GH63677) - Clang now preserves the unexpanded flag in a lambda transform used for pack expansion. (#GH56852), (#GH85667), - (#GH99877). + (#GH99877), (#GH122417). - Fixed a bug when diagnosing ambiguous explicit specializations of constrained member functions. - Fixed an assertion failure when selecting a function from an overload set that includes a specialization of a conversion function template. diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 4a3c739ecbeab..79df5cf4f2bb5 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -8496,7 +8496,7 @@ TreeTransform::TransformDeclStmt(DeclStmt *S) { getSema() .getASTContext() .getTypeDeclType(TD) - .getCanonicalType() + .getSingleStepDesugaredType(getSema().getASTContext()) ->containsUnexpandedParameterPack(); if (auto *VD = dyn_cast(Transformed)) diff --git a/clang/test/SemaCXX/fold_lambda_with_variadics.cpp b/clang/test/SemaCXX/fold_lambda_with_variadics.cpp index 2257a4c2d975a..69572bea3664a 100644 --- a/clang/test/SemaCXX/fold_lambda_with_variadics.cpp +++ b/clang/test/SemaCXX/fold_lambda_with_variadics.cpp @@ -7,6 +7,8 @@ struct identity { using type = T; }; +template using ElementType = int; + template void f() { static_assert([](Is... x) { @@ -47,6 +49,10 @@ template void f() { }(), ...); }(1, 2); + [](Is...) { + ([] { using T = ElementType; }(), ...); + }(1); + [](auto ...y) { ([y] { }(), ...); }();