https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123789
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #1)
> Can't you use pack indexing? void *ptr = sizeof...(ts) == 0 ? nullptr :
> ts...[sizeof...(ts)-1]; ?
No:
<source>:3:36: error: cannot index an empty pack
3 | void* ptr = sizeof...(ts) == 0 ? nullptr : ts...[sizeof...(ts)-1];
When the pack is empty, ts...[sizeof...(ts)-1] is ill-formed, and the third
operand isn't a discarded statement.
