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

error: expected (primary-)expression when building on FreeBSD 12 #1214

Closed
vedranmiletic opened this issue Jul 1, 2019 · 5 comments
Closed

Comments

@vedranmiletic
Copy link

With Clang 6:

Building CXX object test/CMakeFiles/assert-test.dir/assert-test.cc.o
FAILED: test/CMakeFiles/assert-test.dir/assert-test.cc.o 
/usr/bin/c++  -DFMT_USE_FILE_DESCRIPTORS=1 -DGTEST_HAS_STD_WSTRING=1 -DGTEST_USE_OWN_TR1_TUPLE=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -Iinclude -isystem test/gtest -isystem test/gmock -isystem test/. -O3 -DNDEBUG   -std=gnu++11 -MD -MT test/CMakeFiles/assert-test.dir/assert-test.cc.o -MF test/CMakeFiles/assert-test.dir/assert-test.cc.o.d -o test/CMakeFiles/assert-test.dir/assert-test.cc.o -c test/assert-test.cc
test/assert-test.cc:20:3: error: expected expression
  EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
  ^
test/assert-test.cc:16:52: note: expanded from macro 'EXPECT_DEBUG_DEATH_IF_SUPPORTED'
    GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
                                                   ^

With GCC 8.3:

Building CXX object test/CMakeFiles/assert-test.dir/assert-test.cc.o
FAILED: test/CMakeFiles/assert-test.dir/assert-test.cc.o
/usr/local/bin/g++8  -DFMT_USE_FILE_DESCRIPTORS=1 -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -Iinclude -isystem test/gtest -isystem test/gmock -isystem test/. -O3 -DNDEBUG   -fno-delete-null-pointer-checks -std=gnu++11 -MD -MT test/CMakeFiles/assert-test.dir/assert-test.cc.o -MF test/CMakeFiles/assert-test.dir/assert-test.cc.o.d -o test/CMakeFiles/assert-test.dir/assert-test.cc.o -c test/assert-test.cc
test/assert-test.cc: In member function 'virtual void AssertTest_Fail_Test::TestBody()':
test/assert-test.cc:16:52: error: expected primary-expression before ')' token
     GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
                                                    ^
test/assert-test.cc:20:3: note: in expansion of macro 'EXPECT_DEBUG_DEATH_IF_SUPPORTED'
   EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/assert-test.cc:16:5: error: 'GTEST_UNSUPPORTED_DEATH_TEST' was not declared in this scope
     GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/assert-test.cc:20:3: note: in expansion of macro 'EXPECT_DEBUG_DEATH_IF_SUPPORTED'
   EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/assert-test.cc:16:5: note: suggested alternative: 'GTEST_UNSUPPORTED_DEATH_TEST_'
     GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
test/assert-test.cc:20:3: note: in expansion of macro 'EXPECT_DEBUG_DEATH_IF_SUPPORTED'
   EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"),
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@vitaut
Copy link
Contributor

vitaut commented Jul 2, 2019

Yeah, this looks wrong. GTEST_UNSUPPORTED_DEATH_TEST should just be replaced with printing a warning that death tests are not supported.

@vitaut
Copy link
Contributor

vitaut commented Jul 4, 2019

Should be fixed in bc628f8. Thanks for reporting.

@vitaut vitaut closed this as completed Jul 4, 2019
@jackyf
Copy link

jackyf commented Feb 18, 2020

Intesting. In the version of GTest we have in Debian, it's the opposite (the macro is provided without a trailing underscore).

@vitaut
Copy link
Contributor

vitaut commented Feb 24, 2020

@jackyf, I replaced use of the internal macro with printing a warning if debug tests are not supported: 13d82e3.

@jackyf
Copy link

jackyf commented Feb 26, 2020

@vitaut: Thanks, it will allow us to drop the local patch.

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

3 participants