Googletest: TYPED_TEST_SUITE - Must specify at least one argument for '...' parameter of variadic macro

Created on 4 Jun 2019  路  8Comments  路  Source: google/googletest

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

Most helpful comment

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, );

All 8 comments

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, );
Was this page helpful?
0 / 5 - 0 ratings