On Tue, Apr 25, 2023 at 5:34 PM Edward Catmur via Std-Discussion <std-discussion@lists.isocpp.org> wrote:

On Tue, 25 Apr 2023 at 14:39, Thiago Macieira via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
On Tuesday, 25 April 2023 11:53:46 PDT Lukas Barth via Std-Discussion wrote:
> At this point I'm at my wit's end. How is that rule to be interpreted?

Why are you trying to interpret it? Can't you just assume that if the type
isn't a trivial scalar, it can't be passed?

An enum is a trivial scalar.

 > Could it be that this use of "compatible" in `[stdarg.syn]/1.2` was
grandfathered in from C, but is not defined anymore?


It seems that we need to open an LWG issue about this. "Compatible" is indeed not defined and we cannot simply assume that it means what it means in the C standard, because not every C++ type is a valid C type, meaning that it would not be clear how to apply the definition from C.

Lukas, please email lwgchair@gmail.com to submit an LWG issue. If you don't have time to do it, I can do it for you.

> What is "the type that results when passing an argument for which
there is no parameter"?

See http://eel.is/c++draft/expr.call#11.sentence-1 . In other words, you can use a parameter as the second argument to va_start if it is a type such that you could retrieve it from ellipsis using va_arg (i.e., if there was a preceding parameter).

Std-Discussion mailing list

Brian Bi