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
103
103
ifuncs. Its purpose was to preserve backwards compatibility when the ".ifunc"
104
104
suffix got removed from the name mangling. The alias interacts badly with
105
105
GlobalOpt (see the issue #96197).
106
-
106
+
107
107
- Fixed Microsoft name mangling for auto non-type template arguments of pointer
108
108
type for MSVC 1920+. This change resolves incompatibilities with code compiled
109
109
by MSVC 1920+ but will introduce incompatibilities with code compiled by
@@ -1024,6 +1024,8 @@ Bug Fixes to C++ Support
1024
1024
- Fixed a bug where references to lambda capture inside a ``noexcept `` specifier were not correctly
1025
1025
instantiated. (#GH95735).
1026
1026
- 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)
1027
1029
1028
1030
Bug Fixes to AST Handling
1029
1031
^^^^^^^^^^^^^^^^^^^^^^^^^
Original file line number Diff line number Diff line change @@ -1380,6 +1380,8 @@ void Sema::ActOnLambdaClosureParameters(
1380
1380
AddTemplateParametersToLambdaCallOperator (LSI->CallOperator , LSI->Lambda ,
1381
1381
TemplateParams);
1382
1382
LSI->Lambda ->setLambdaIsGeneric (true );
1383
+ LSI->ContainsUnexpandedParameterPack |=
1384
+ TemplateParams->containsUnexpandedParameterPack ();
1383
1385
}
1384
1386
LSI->AfterParameterList = true ;
1385
1387
}
Original file line number Diff line number Diff line change @@ -20,3 +20,24 @@ void foo() {
20
20
take_by_ref (x);
21
21
}
22
22
}
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