From 9603a73421e7f141f73e12cb2ad88d7b6fcc9e61 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 25 Nov 2018 16:05:00 -0800 Subject: [PATCH] constexpr std::string_view -> const std::string_view This works around gcc 7.2/clang rC347417 which have a bad interaction with libstdc++'s implementation of P0426 constexpr std::string_view also emits a string_view object in .rodata that cannot be optimized out by clang (which means larger object file size) So use good old const. --- src/pipeline.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipeline.cc b/src/pipeline.cc index 3e6bbece..feed8880 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -412,8 +412,8 @@ void LaunchStdin() { std::thread([]() { set_thread_name("stdin"); std::string str; + const std::string_view kContentLength("Content-Length: "); while (true) { - constexpr std::string_view kContentLength("Content-Length: "); int len = 0; str.clear(); while (true) {