FixedStringTest build fails on Ubuntu 20.04 due to errors with constant expressions
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to build folly latest master (rev f5744f58a) on Ubuntu 20.04 x86_64 with 9.3.0. The build fails with the following error:
```
FAILED: CMakeFiles/fixed_string_test.dir/folly/test/FixedStringTest.cpp.o
/data/user/Tools/lib/ccache/c++ -DBOOST_ALL_NO_LIB -DFMT_LOCALE -DFOLLY_XLOG_STRIP_PREFIXES=\"/home/user/folly:/data/user/Debug/folly\" -DGFLAGS_IS_A_DLL=0 -DGOOGLE_GLOG_DLL_DECL="" -DGOOGLE_GLOG_DLL_DECL_FOR_UNITTESTS="" -D_GNU_SOURCE -D_REENTRANT -I/home/user/folly -I. -isystem /data/user/Debug/include -ggdb3 -fno-omit-frame-pointer -O1 -m64 -march=skylake -DDEBUG -g -g -Wall -Wextra -fPIE -g -std=gnu++1z -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wunused-label -Wunused-result -Wshadow-compatible-local -Wno-noexcept-type -faligned-new -fopenmp -pthread -std=gnu++17 -MD -MT CMakeFiles/fixed_string_test.dir/folly/test/FixedStringTest.cpp.o -MF CMakeFiles/fixed_string_test.dir/folly/test/FixedStringTest.cpp.o.d -o CMakeFiles/fixed_string_test.dir/folly/test/FixedStringTest.cpp.o -c /home/user/folly/folly/test/FixedStringTest.cpp
In file included from /home/user/folly/folly/Range.h:26,
from /home/user/folly/folly/FixedString.h:33,
from /home/user/folly/folly/test/FixedStringTest.cpp:20:
/home/user/folly/folly/portability/Constexpr.h: In member function ‘virtual void FixedStringEraseTest_CEraseTest_Test::TestBody()’:
/home/user/folly/folly/test/FixedStringTest.cpp:420:42: in ‘constexpr’ expansion of ‘x.folly::BasicFixedString::cerase(x.folly::BasicFixedString::size(), ((std::size_t)folly::detail::fixedstring::FixedStringBase_<>::npos))’
/home/user/folly/folly/FixedString.h:1476:19: in ‘constexpr’ expansion of ‘((const folly::BasicFixedString*)this)->folly::BasicFixedString::creplace<1>(pos, folly::detail::fixedstring::checkOverflowOrNpos(count, (((long unsigned int)((const folly::BasicFixedString*)this)->folly::BasicFixedString::size_) - folly::detail::fixedstring::checkOverflow(pos, ((std::size_t)((const folly::BasicFixedString*)this)->folly::BasicFixedString::size_)))), A{})’
/home/user/folly/folly/FixedString.h:1898:59: in ‘constexpr’ expansion of ‘((const folly::BasicFixedString*)this)->folly::BasicFixedString::creplace<1>(this_pos, this_count, (* & that), 0, (1 - 1))’
/home/user/folly/folly/FixedString.h:1938:49: in ‘constexpr’ expansion of ‘folly::detail::fixedstring::checkNullTerminated((* & that))’
/home/user/folly/folly/FixedString.h:100:61: in ‘constexpr’ expansion of ‘folly::constexpr_strlen(((const char*)a))’
/home/user/folly/folly/portability/Constexpr.h:103:43: in ‘constexpr’ expansion of ‘folly::detail::constexpr_strlen_internal(s, 0)’
/home/user/folly/folly/portability/Constexpr.h:48:29: error: ‘strlen(((const char*)(&)))’ is not a constant expression
48 | return FOLLY_DETAIL_STRLEN(s);
| ^
/home/user/folly/folly/test/FixedStringTest.cpp:421:21: error: non-constant condition for static assertion
421 | static_assert(26u == tmp0.size(), "");
| ~~~~^~~~~~~~~~~~~~
/home/user/folly/folly/test/FixedStringTest.cpp:422:19: error: non-constant condition for static assertion
422 | static_assert(y == tmp0, "");
| ~~^~~~~~~
/home/user/folly/folly/test/FixedStringTest.cpp:424:21: error: non-constant condition for static assertion
424 | static_assert(24u == tmp1.size(), "");
| ~~~~^~~~~~~~~~~~~~
/home/user/folly/folly/test/FixedStringTest.cpp:425:44: error: non-constant condition for static assertion
425 | static_assert("abcdefghijklmnopqrstuvwx" == tmp1, "");
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/home/user/folly/folly/test/FixedStringTest.cpp:427:20: error: non-constant condition for static assertion
427 | static_assert(2u == tmp2.size(), "");
| ~~~^~~~~~~~~~~~~~
/home/user/folly/folly/test/FixedStringTest.cpp:428:22: error: non-constant condition for static assertion
428 | static_assert("ax" == tmp2, "");
| ~~~~~^~~~~~~
```
Contributor guide
Assessment
This issue has not been assessed yet.