Clang-tidy enabling C++17 extensions

Viewed 1477

I use Visual Studio 2019 and clang-tidy. I have a file in my solution with name .clang-tidy and it has rows like

modernize-, -modernize-pass-by-value*

I've used if statements with initializer which has come with C++17 standards but I get a warning:

I'd like to use C++17 standards without getting a warning.

'if' initialization statements are a C++17 extension.

I saw that it is related with flag -Wc++17-extensions but could not manage to solve it.

-extra-arg=-std=c++17 a solution which can be passed as a command line argument while compiling but I don't know where to write it in my case because I am not compiling from command line.

1 Answers
Related