google / google/fuzztest

Errors on compilation

Open
#206 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.1k
Forks
137
Avg merge
3d 6h
Merged PRs (30d)
22

Description

I'm following the Quickstart with CMake, and when I try to compile I get the following error.
```
[ 96%] Building CXX object fuzztest/fuzztest/CMakeFiles/fuzztest_logging.dir/internal/logging.cc.o
c++: error: unrecognized command line option '-fsanitize-coverage=0'; did you mean '-fsanitize-recover=leak'?
gmake[2]: *** [fuzztest/fuzztest/CMakeFiles/fuzztest_logging.dir/build.make:76: fuzztest/fuzztest/CMakeFiles/fuzztest_logging.dir/internal/logging.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:6653: fuzztest/fuzztest/CMakeFiles/fuzztest_logging.dir/all] Error 2
```
Also, if I disable that flag on the CMake (fuzztest/CMakeLists.txt:29 and fuzztest/CMakeLists.txt:30) I get the following error:

```
[ 96%] Building CXX object fuzztest/fuzztest/CMakeFiles/fuzztest_type_support.dir/internal/type_support.cc.o
In file included from xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h:36:0,
from xxx/first_fuzz_project/fuzztest/fuzztest/internal/type_support.cc:15:
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/meta.h: In lambda function:
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/meta.h:67:39: error: parameter packs not expanded with '...':
[](F& f) { return std::move(f)(decltype(I){}); }...};
~~~~~~~~~~~~^~~~~~~~~~~~~~~
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/meta.h:67:39: note: 'I'
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/meta.h: In lambda function:
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/meta.h:67:57: error: expansion pattern '' contains no argument packs
[](F& f) { return std::move(f)(decltype(I){}); }...};
^~~
In file included from xxx/first_fuzz_project/fuzztest/fuzztest/internal/type_support.cc:15:0:
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h: In function 'void fuzztest::internal::PrintValue(const Domain&, fuzztest::internal::corpus_type_t&, fuzztest::internal::RawSink, fuzztest::internal::PrintMode)':
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h:101:66: error: expression '' is not a constant expression
corpus_value, out, mode)) {})) {
^
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h: In member function 'void fuzztest::internal::OptionalPrinter::PrintCorpusValue(fuzztest::internal::corpus_type_t&, fuzztest::internal::RawSink, fuzztest::internal::PrintMode) const':
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h:255:35: error: the value of 'is_pointer' is not usable in a constant expression
if constexpr (is_pointer) {
^
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h:242:20: note: 'is_pointer' used in its own initializer
constexpr bool is_pointer = Requires(
^~~~~~~~~~
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h: In member function 'void fuzztest::internal::ProtobufPrinter::PrintUserValue(const T&, fuzztest::internal::RawSink, fuzztest::internal::PrintMode) const':
xxx/first_fuzz_project/fuzztest/./fuzztest/internal/type_support.h:291:61: error: expression '' is not a constant expression
if constexpr (Requires([](auto v) -> decltype(*v) {})) {
^
gmake[2]: *** [fuzztest/fuzztest/CMakeFiles/fuzztest_type_support.dir/build.make:76: fuzztest/fuzztest/CMakeFiles/fuzztest_type_support.dir/internal/type_support.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:5941: fuzztest/fuzztest/CMakeFiles/fuzztest_type_support.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
```

I'm using clang-13

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.