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.
This commit is contained in:
Øystein Myrmo 2022-03-22 14:32:14 +01:00 committed by Davis E. King
parent e9d49fee8f
commit 5cb036564c
1 changed files with 2 additions and 0 deletions

View File

@ -26,8 +26,10 @@ public:
{ {
thread_local int stuff1 = 999; thread_local int stuff1 = 999;
auto x = 4; auto x = 4;
++stuff1;
decltype(x) asdf = 9; decltype(x) asdf = 9;
++asdf;
auto f = []() { cout << "in a lambda!" << endl; }; auto f = []() { cout << "in a lambda!" << endl; };
f(); f();