[Bug c++/93191] Conversions to arrays of unknown bound P0388 Fails for variadic args

wjwray at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Feb 12 18:08:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93191

--- Comment #2 from Will Wray <wjwray at gmail dot com> ---
Actually, the issue now appears to be not with variadic args directly but with
deduction (variadic Args are necessarily deduced, whether via template Arg or
auto placeholder).

So, for single arg, this works with explicit type (i.e. without deduction)
(works on GCC trunk, not Clang trunk as P0388 isn't implemented there yet)
(I thought I'd tested this single-arg case before submitting; maybe not):

    void cat(char const(&cstr)[]) { puts(cstr); }
    int main() {
        cat("Hello");
    }

But, changing char -> auto placeholder, this fails:

    void cat(auto const(&cstr)[]) { puts(cstr); }
    int main() {
        cat("Hello");  // error: no matching function
    }

So - "Not quite sure if this is valid"; that's the question...

Can check / ask here I guess:

https://github.com/cplusplus/draft/pull/3090
https://github.com/cplusplus/draft/commit/d910b2d9361c3ed1f908f77c8f76bd3e27093c90


More information about the Gcc-bugs mailing list