Commit 336bfca0 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Fixed constexpr append in FixedString tests

Summary:
[Folly] Fixed constexpr append in `FixedString` tests after {D15618465}.

```
folly/test/FixedStringTest.cpp: In member function 'virtual void FixedStringAssignTest_ConstexprAppendLiteral_Test::TestBody()':
folly/test/FixedStringTest.cpp:360:3: error: non-constant condition for static assertion
   static_assert(constexpr_append_literal_test() == "hello world!", "");
   ^~~~~~~~~~~~~
In file included from folly/Range.h:25:0,
                 from folly/FixedString.h:33,
                 from folly/test/FixedStringTest.cpp:20:
folly/test/FixedStringTest.cpp:360:47:   in constexpr expansion of 'constexpr_append_literal_test()'
folly/test/FixedStringTest.cpp:355:18:   in constexpr expansion of '#'result_decl' not supported by dump_expr#<expression error>.folly::BasicFixedString<char, 20>::append((& s[7]))'
folly/FixedString.h:1277:48:   in constexpr expansion of 'folly::constexpr_strlen<char>(that)'
folly/portability/Constexpr.h:68:21: error: 'strlen((& s[7]))' is not a constant expression
   return std::strlen(s);
          ~~~~~~~~~~~^~~
```

Reviewed By: simpkins

Differential Revision: D15643402

fbshipit-source-id: c7e26a0c37c956300364c566f211c866985d9dc2
parent 74f760d6
......@@ -350,9 +350,8 @@ TEST(FixedStringAssignTest, RuntimeAppendString) {
constexpr folly::FixedString<20> constexpr_append_literal_test() {
folly::FixedString<20> a{"hello"};
a.append(1u, ' ');
constexpr char s[] = "X world!";
a.append(&s[2u], 5u);
a.append(&s[7u]);
a.append("world foo bar baz", 5u);
a.append("!");
return a;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment