From 78a596f109f3eb852620ec0be655894547769555 Mon Sep 17 00:00:00 2001 From: Igor Sugak Date: Tue, 7 Nov 2017 15:59:54 -0800 Subject: [PATCH] fix -Wunused-variable Summary: Exposed by the latest clang: ```lang=bash folly/test/FixedStringTest.cpp:52:36: error: unused variable 's' [-Werror,-Wunused-variable] constexpr folly::FixedString<42> s{"hello world"}; ^ folly/gen/test/StringBenchmark.cpp:176:15: error: unused variable 'line' [-Werror,-Wunused-variable] StringPiece line(kLine); ^ ``` Reviewed By: yfeldblum Differential Revision: D6264853 fbshipit-source-id: 5cf4b0a8c99eaa31c2499746c70ddc49fdd73074 --- folly/gen/test/StringBenchmark.cpp | 1 - folly/test/FixedStringTest.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/gen/test/StringBenchmark.cpp b/folly/gen/test/StringBenchmark.cpp index 1300335f..96143b08 100644 --- a/folly/gen/test/StringBenchmark.cpp +++ b/folly/gen/test/StringBenchmark.cpp @@ -173,7 +173,6 @@ BENCHMARK_RELATIVE(StringUnsplit_Old_ReusedBuffer, iters) { BENCHMARK_RELATIVE(StringUnsplit_Gen, iters) { size_t s = 0; - StringPiece line(kLine); while (iters--) { fbstring joined = from(testStrVector) | unsplit(','); s += joined.size(); diff --git a/folly/test/FixedStringTest.cpp b/folly/test/FixedStringTest.cpp index 437bd67c..bf3e943d 100644 --- a/folly/test/FixedStringTest.cpp +++ b/folly/test/FixedStringTest.cpp @@ -50,6 +50,7 @@ TEST(FixedStringCtorTest, Default) { TEST(FixedStringCtorTest, FromLiterals) { constexpr folly::FixedString<42> s{"hello world"}; + static_assert(s[0] == 'h', ""); constexpr folly::FixedString<11> s2{"hello world"}; static_assert(s2[0] == 'h', ""); static_assert(s2[10] == 'd', ""); -- 2.34.1