I am getting compilation issue with -std=c++17 or c++20 , why so ?
root@94275cd4851f:/workspace/*************# cat test.cpp
#include <iostream>
#define JOURNAL_METHOD_VOID(...) myprint("tt", ##__VA_ARGS__)
void myprint(const char* str, ...) {
}
int main() {
// JOURNAL_METHOD_VOID("1", "2", "3");
JOURNAL_METHOD_VOID();
return 0;
}
root@94275cd4851f:/workspace/*************# g++ -std=c++17 -c test.cpp -o test_cpp17.o 2>&1
test.cpp: In function 'int main()':
test.cpp:2:61: error: expected primary-expression before ')' token
2 | #define JOURNAL_METHOD_VOID(...) myprint("tt", ##__VA_ARGS__)
| ^
test.cpp:9:5: note: in expansion of macro 'JOURNAL_METHOD_VOID'
9 | JOURNAL_METHOD_VOID();
| ^~~~~~~~~~~~~~~~~~~
I am getting compilation issue with -std=c++17 or c++20 , why so ?