https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113307
Bug ID: 113307
Summary: fails to diagnose an explicit object parameter to be a
function parameter pack
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: cooky.ykooc922 at gmail dot com
Target Milestone: ---
With the recent support of explicit parameter object functions, the compiler
fails to diagnose the aforementioned function to be a function parameter pack.
struct A {
void f(this A);
// bug: no error
// correct behavior: must be error
template <typename... Args>
void g(this Args&&...);
template <typename... Args>
void h(this A, Args&&...);
};
Clang and MSVC seem to reject the code snippet above which is valid according
to the standard https://eel.is/c++draft/dcl.fct:
"An explicit object parameter shall not be a function parameter pack
([temp.variadic])."
godbolt link:
https://godbolt.org/z/Es6Mzba59