Clang will error out if va_start is used from a lambda with C-style variadic arguments, unless the parent function also has variadic arguments.
Steps to reproduce
Compile attached file.
Expected result
Program should (probably?) compile and return 88 on execution.
Actual result
Clang errors out:
test.cpp:8:3: error: 'va_start' used in function with fixed args
va_start(ap, a);
Additional information
I'm not a language lawyer, so I'm not sure if lambdas with variadic arguments are allowed. However, I'm pretty confident that either lambdas with variadic arguments should always cause an error (including when the parent function also has variadic parameters), or that they should work on their own.
g++ 4.8.1 seems to accept lambdas with variadic arguments (or at least accepts the attached program).
Extended Description
Overview
Clang will error out if
va_start
is used from a lambda with C-style variadic arguments, unless the parent function also has variadic arguments.Steps to reproduce
Compile attached file.
Expected result
Program should (probably?) compile and return 88 on execution.
Actual result
Clang errors out:
Additional information
I'm not a language lawyer, so I'm not sure if lambdas with variadic arguments are allowed. However, I'm pretty confident that either lambdas with variadic arguments should always cause an error (including when the parent function also has variadic parameters), or that they should work on their own.
g++ 4.8.1 seems to accept lambdas with variadic arguments (or at least accepts the attached program).