googletest
googletest copied to clipboard
TYPED_TEST_SUITE - Must specify at least one argument for '...' parameter of variadic macro
When using TYPED_TEST_SUITE below error happens. (using master) Here is log from clang:
path:14:48: error: must specify at least one argument for '...' parameter of variadic macro
[-Werror,-Wgnu-zero-variadic-macro-arguments]
TYPED_TEST_SUITE(XYZ, MyTypes );
^
path/gtest/googletest/include/gtest/gtest-typed-test.h:194:9: note: macro 'TYPED_TEST_SUITE' defined here
#define TYPED_TEST_SUITE(CaseName, Types, ...)
^
1 error generated.
Seems like continuation of #2069
I have to refer to the previous comment https://github.com/google/googletest/issues/2069#issuecomment-457362864
Ping?
Hi! I've got exactly the same problem now. In the referred issue you wrote it was eventually fixed. Can we expect another patch for that?
Any update on this? @gennadiycivil
When warnings provide no value turning them off is a great solution.
Basically the same issue was fixed in the past: #2063
Maybe we can you that as base to propose a PR.
Hello @marehr, FYI there is strong opposition against introducing new macros in this project. I'd recommend sticking to EricWF's advice.
For reference and other people encountering this warning: see https://github.com/google/googletest/issues/1419#issuecomment-381423292 , that you can silence the warning by adding a comma and an empty macro argument, transforming
TYPED_TEST_SUITE(TestName, TestTypes);
to
TYPED_TEST_SUITE(TestName, TestTypes, );
Btw. C++20 has solved this issue by changing the requirements on variadic macros and the appropriate patch has been merged to Clang project and released since Clang 14.
The warning wasn't very useful but it was correct. You'll have no issues on C++20 or higher in Clang 14 or higher.