ned14 / quickcpplib

Eliminate all the tedious hassle when making state-of-the-art C++ 14 - 23 libraries!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"error: expected '{' before '->' token" on GCC 9 and higher

OPNA2608 opened this issue · comments

Build errors on GCC 9 and 10 like this, succeeds on GCC 6-8 and LLVM Clang 7. (Linux)

-- Build files have been written to: /build/source/build
cmake: enabled parallel building
building
build flags: -j3 -l3 SHELL=/nix/store/58in3hsawf6g1adx99sphi460nzmaqxq-bash-4.4-p23/bin/bash
Scanning dependencies of target quickcpplib_hl--uint128
Scanning dependencies of target quickcpplib_hl--signal_guard
Scanning dependencies of target quickcpplib_hl--open_hash_index
[  4%] Building CXX object CMakeFiles/quickcpplib_hl--open_hash_index.dir/test/open_hash_index.cpp.o
[ 12%] Building CXX object CMakeFiles/quickcpplib_hl--signal_guard.dir/test/signal_guard.cpp.o
[ 12%] Building CXX object CMakeFiles/quickcpplib_hl--uint128.dir/test/uint128.cpp.o
/build/source/test/signal_guard.cpp: In lambda function:
/build/source/test/signal_guard.cpp:46:28: error: expected '{' before '->' token
   46 |                            ->int {
      |                            ^~
/build/source/test/signal_guard.cpp: In function 'void boostlite_auto_test_suite0::boostlite_auto_test_case1()':
/build/source/test/signal_guard.cpp:46:28: error: base operand of '->' has non-pointer type 'boostlite_auto_test_suite0::boostlite_auto_test_case1()::<lambda()>'
/build/source/test/signal_guard.cpp:46:30: error: expected unqualified-id before 'int'
   46 |                            ->int {
      |                              ^~~
make[2]: *** [CMakeFiles/quickcpplib_hl--signal_guard.dir/build.make:83: CMakeFiles/quickcpplib_hl--signal_guard.dir/test/signal_guard.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:157: CMakeFiles/quickcpplib_hl--signal_guard.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 16%] Linking CXX executable bin/quickcpplib_hl--uint128
[ 16%] Built target quickcpplib_hl--uint128
[ 20%] Linking CXX executable bin/quickcpplib_hl--open_hash_index
[ 20%] Built target quickcpplib_hl--open_hash_index
make: *** [Makefile:161: all] Error 2
builder for '/nix/store/6j845g08lnl761d3527fslwri4j0q59c-quickcpplib-unstable-2020-07-30.drv' failed with exit code 2

Upstreamed to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96485. Thanks for reporting it!

Fixed better for [gcc] 9.4/10.3/11.

According to upstream.