The sample variadic_macros.cpp from MSDN fails with com.sonar.sslr.api.RecognitionException
#define MACRO(s, ...) printf(s, __VA_ARGS__)
int main() {
MACRO("hello, world\n");
}
The syntax tree is created for the next code sample but error messages are shown:
#define EMPTY
#define MACRO(s, ...) printf(s, __VA_ARGS__)
int main() {
MACRO("error\n", EMPTY); // would cause error C2059, except VC++
// suppresses the trailing comma
}
e.g.
08:22:26.021 [AWT-EventQueue-0] ERROR CxxPreprocessor - Mismatch: expected ',' got: ')'