https://bugs.llvm.org/show_bug.cgi?id=47852
Bug ID: 47852
Summary: Accepts-invalid with parameter pack expansion in
lambda capture
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: C++17
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Referring to this gcc bug report
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97358#c2), clang accepts this
seemingly invalid code:
```
template <typename... T> void foo (T... x)
{
}
template <typename... T> void bar (T... x)
{
foo ([x...] { static_cast<void> (x); }...);
}
void
test ()
{
bar ();
bar (1);
bar (2.0, 3LL, 4);
}
```
gcc trunk produces these errors now:
```
<source>: In lambda function:
<source>:7:17: error: parameter packs not expanded with '...':
7 | foo ([x...] { static_cast<void> (x); }...);
| ^~~~~~~~~~~~~~~~~~~~~
<source>:7:17: note: 'x'
<source>: In function 'void bar(T ...)':
<source>:7:41: error: expansion pattern '<lambda>' contains no parameter packs
7 | foo ([x...] { static_cast<void> (x); }...);
| ^~~
ASM generation compiler returned: 1
<source>: In lambda function:
<source>:7:17: error: parameter packs not expanded with '...':
7 | foo ([x...] { static_cast<void> (x); }...);
| ^~~~~~~~~~~~~~~~~~~~~
<source>:7:17: note: 'x'
<source>: In function 'void bar(T ...)':
<source>:7:41: error: expansion pattern '<lambda>' contains no parameter packs
7 | foo ([x...] { static_cast<void> (x); }...);
| ^~~
Execution build compiler returned: 1
```
Earlier gcc versions produced an ICE, which the mentioned bug was about.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs