File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ ABI Changes in This Version
103103 ifuncs. Its purpose was to preserve backwards compatibility when the ".ifunc"
104104 suffix got removed from the name mangling. The alias interacts badly with
105105 GlobalOpt (see the issue #96197).
106-
106+
107107- Fixed Microsoft name mangling for auto non-type template arguments of pointer
108108 type for MSVC 1920+. This change resolves incompatibilities with code compiled
109109 by MSVC 1920+ but will introduce incompatibilities with code compiled by
@@ -1024,6 +1024,8 @@ Bug Fixes to C++ Support
10241024- Fixed a bug where references to lambda capture inside a ``noexcept `` specifier were not correctly
10251025 instantiated. (#GH95735).
10261026- Fixed a CTAD substitution bug involving type aliases that reference outer template parameters. (#GH94614).
1027+ - Clang now correctly handles unexpanded packs in the template parameter list of a generic lambda expression
1028+ (#GH48937)
10271029
10281030Bug Fixes to AST Handling
10291031^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1380,6 +1380,8 @@ void Sema::ActOnLambdaClosureParameters(
13801380 AddTemplateParametersToLambdaCallOperator (LSI->CallOperator , LSI->Lambda ,
13811381 TemplateParams);
13821382 LSI->Lambda ->setLambdaIsGeneric (true );
1383+ LSI->ContainsUnexpandedParameterPack |=
1384+ TemplateParams->containsUnexpandedParameterPack ();
13831385 }
13841386 LSI->AfterParameterList = true ;
13851387}
Original file line number Diff line number Diff line change @@ -20,3 +20,24 @@ void foo() {
2020 take_by_ref (x);
2121}
2222}
23+
24+ namespace GH48937 {
25+
26+ template <typename ... Ts>
27+ consteval int f (Ts... ts) {
28+ return ([]<Ts a = 42 >(){ return a;}, ...)();
29+ }
30+
31+ static_assert (f(0 , 42 ) == 42 );
32+
33+ template <typename Ts>
34+ int g (Ts ts) {
35+ return ([]<Ts a = 42 >(){ return a;}, ...)(); // expected-error {{pack expansion does not contain any unexpanded parameter packs}}
36+ }
37+
38+ template <typename ... Ts>
39+ int h (Ts... ts) {
40+ return ([]<Ts a = 42 >(){ return a;})(); // expected-error {{expression contains unexpanded parameter pack 'Ts'}}
41+ }
42+
43+ }
You can’t perform that action at this time.
0 commit comments