Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYPED_TEST_SUITE - Must specify at least one argument for '...' parameter of variadic macro #2271

Open
jasiux92 opened this issue Jun 4, 2019 · 9 comments

Comments

@jasiux92
Copy link

jasiux92 commented Jun 4, 2019

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

@gennadiycivil
Copy link
Contributor

I have to refer to the previous comment #2069 (comment)

@gennadiycivil
Copy link
Contributor

Ping?

@kuzkry
Copy link
Contributor

kuzkry commented Jun 25, 2019

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?

@muttleyxd
Copy link

muttleyxd commented Jul 8, 2019

Any update on this? @gennadiycivil

kuzkry referenced this issue in kuzkry/googletest Jul 9, 2019
…generation of type- and type-parametrized tests

Clang issues such a warning for TYPED_TEST_SUITE:
must specify at least one argument for '...' parameter of variadic macro

Until now code hasn't been standard conforming (though since C++20 it will be), read:
https://en.cppreference.com/w/cpp/preprocessor/replace
@EricWF
Copy link

EricWF commented Aug 10, 2019

When warnings provide no value turning them off is a great solution.

mrks pushed a commit to hyrise/hyrise that referenced this issue Sep 16, 2019
Updates the third party module of the Google Test framework.

With it goes the necessity to add an empty item at the list of some test instantiations and thus also some NOLINT are removed.

For TYPED_TEST_SUITE the problem remains (google/googletest#2271).
@marehr
Copy link

marehr commented Dec 17, 2019

Basically the same issue was fixed in the past: #2063

Maybe we can you that as base to propose a PR.

@kuzkry
Copy link
Contributor

kuzkry commented Dec 18, 2019

Hello @marehr, FYI there is strong opposition against introducing new macros in this project. I'd recommend sticking to EricWF's advice.

@sethrj
Copy link

sethrj commented Jul 29, 2020

For reference and other people encountering this warning: see #1419 (comment) , 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, );

d0k added a commit to llvm/llvm-project that referenced this issue May 17, 2021
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271
arichardson pushed a commit to arichardson/llvm-project that referenced this issue Sep 12, 2021
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271
arames pushed a commit to llvm/llvm-project that referenced this issue Sep 14, 2021
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271
arames pushed a commit to llvm/llvm-project that referenced this issue Sep 26, 2021
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271

Reviewed By: arames, bkramer

Differential Revision: https://reviews.llvm.org/D110283
@kuzkry
Copy link
Contributor

kuzkry commented Jul 5, 2022

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.

mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271
vgvassilev pushed a commit to vgvassilev/clang that referenced this issue Dec 28, 2022
This avoids a -pedantic warning:
warning: ISO C++11 requires at least one argument for the "..." in a variadic macro

See also google/googletest#2271

llvm-monorepo: 05de4b413930418b60c0dd1e72681b476b50e7fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants