From 5cb036564c986fcc45eb16dd0174b1602ceb4f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Myrmo?= Date: Tue, 22 Mar 2022 14:32:14 +0100 Subject: [PATCH] Make Clang compile cpp11_test.cpp without warnings Warnings about unused variables are quenched by simply incrementing the variables in question. This makes the try_compile() call in CMake succeed without warnings when checking for C++11 compatibility and using -Wall. --- dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp b/dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp index 6cc4f479b..59ca7e8e1 100644 --- a/dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp +++ b/dlib/cmake_utils/test_for_cpp11/cpp11_test.cpp @@ -26,8 +26,10 @@ public: { thread_local int stuff1 = 999; auto x = 4; + ++stuff1; decltype(x) asdf = 9; + ++asdf; auto f = []() { cout << "in a lambda!" << endl; }; f();