benchmark: [BUG] 1.8.0: Tests fail to compile: too many arguments provided to function-like macro invocation

Describe the bug

FAILED: test/CMakeFiles/cxx03_test.dir/cxx03_test.cc.o 
/usr/local/libexec/ccache/c++ -DHAVE_POSIX_REGEX -DHAVE_STD_REGEX -DHAVE_STEADY_CLOCK -DHAVE_THREAD_SAFETY_ATTRIBUTES -DTEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS -I/usr/ports/devel/benchmark/work/benchmark-1.8.0/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -Wall  -Wextra  -Wshadow  -Wfloat-equal  -Werror  -pedantic  -pedantic-errors  -Wshorten-64-to-32  -fstrict-aliasing  -Wno-deprecated-declarations  -Wno-deprecated  -Wstrict-aliasing  -Wthread-safety -O2 -pipe -fstack-protector-strong -fno-strict-aliasing     -std=c++98 -fvisibility=hidden -fvisibility-inlines-hidden   -UNDEBUG -w -MD -MT test/CMakeFiles/cxx03_test.dir/cxx03_test.cc.o -MF test/CMakeFiles/cxx03_test.dir/cxx03_test.cc.o.d -o test/CMakeFiles/cxx03_test.dir/cxx03_test.cc.o -c /usr/ports/devel/benchmark/work/benchmark-1.8.0/test/cxx03_test.cc
In file included from /usr/ports/devel/benchmark/work/benchmark-1.8.0/test/cxx03_test.cc:5:
In file included from /usr/ports/devel/benchmark/work/benchmark-1.8.0/include/benchmark/benchmark.h:179:
In file included from /usr/include/c++/v1/algorithm:1712:
In file included from /usr/include/c++/v1/memory:842:
In file included from /usr/include/c++/v1/__algorithm/move.h:12:
/usr/include/c++/v1/__algorithm/iterator_operations.h:101:9: error: too many arguments provided to function-like macro invocation
        "It looks like your iterator's `iterator_traits<It>::reference` does not match the return type of "
        ^
/usr/include/sys/cdefs.h:284:9: note: macro '_Static_assert' defined here
#define _Static_assert(x, y)    __Static_assert(x, __COUNTER__)
        ^

System Which OS, compiler, and compiler version are you using:

  • OS: FreeBSD 13.2
  • Compiler and version: clang-15

To reproduce run tests

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 29 (3 by maintainers)

Most upvoted comments

The immediate cause of the problem is that the “static_assert” macro existing since c++11 is used with -std=c++98. You use -std=c++98 for tests for some reason.