From 675d99a6564c061d882efed04b24712e8e71c107 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 30 Jan 2020 05:05:03 +0300 Subject: [PATCH] Completely silence false-positive clang 3.4 warning. GitOrigin-RevId: 22751006d9199aba9c60224572f072b0387affa0 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e2d9c679..9941ef210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,10 @@ if (GCC AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)) # see http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579 add_cxx_compiler_flag("-Wno-redundant-move") endif() +if (CLANG AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)) + # https://stackoverflow.com/questions/26744556/warning-returning-a-captured-reference-from-a-lambda + add_cxx_compiler_flag("-Wno-return-stack-address") +endif() #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem /usr/include/c++/v1") #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")