From 23e6e3e897250fc044fc0c5adc9ffc574ea5b935 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 rC347417 which has 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pipeline.cc b/src/pipeline.cc index 054584ac..c91f338d 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -424,8 +424,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) { @@ -465,7 +465,6 @@ void LaunchStdin() { std::string method; ReflectMember(reader, "id", id); ReflectMember(reader, "method", method); - auto param = std::make_unique(); on_request->PushBack( {id, std::move(method), std::move(message), std::move(document)});