__builtin_va_list ap;
class string;
void f(const string& s, ...) { __builtin_va_start(ap, s); }
void g(register int i, ...) { __builtin_va_start(ap, i); }
void no_params(...) {
int a;
__builtin_va_start(ap, a); }
void record_context(int a, ...) {
struct Foo {
void meth(int a, int b = (__builtin_va_start(ap, a), 0)) {}
};
}
void promotable(int a, ...) {
enum Unscoped1 { One = 0x7FFFFFFF };
(void)__builtin_va_arg(ap, Unscoped1);
enum Unscoped2 { Two = 0xFFFFFFFF };
(void)__builtin_va_arg(ap, Unscoped2);
enum class Scoped { Three };
(void)__builtin_va_arg(ap, Scoped);
enum Fixed : int { Four };
(void)__builtin_va_arg(ap, Fixed);
enum FixedSmall : char { Five };
(void)__builtin_va_arg(ap, FixedSmall);
enum FixedLarge : long long { Six };
(void)__builtin_va_arg(ap, FixedLarge);
(void)__builtin_va_arg(ap, const volatile int);
(void)__builtin_va_arg(ap, unsigned int);
(void)__builtin_va_arg(ap, bool); }
#if __cplusplus >= 201103L
void fixed_lambda_varargs_function(int a, ...) {
[](int b) {
__builtin_va_start(ap, b); }(42);
}
void varargs_lambda_fixed_function(int a) {
[](int b, ...) {
__builtin_va_start(ap, b); }(42);
}
auto fixed_lambda_global = [](int f) {
__builtin_va_start(ap, f); };
auto varargs_lambda_global = [](int f, ...) {
__builtin_va_start(ap, f); };
void record_member_init(int a, ...) {
struct Foo {
int a = 0;
int b = (__builtin_va_start(ap, a), 0);
};
}
#endif