Language level for clang-tidy "modernize-*" checks

Hello!

Currently some modernize-* checks in clang-tidy are applied regardless of
the C++ standard used (some of them having comments like "Because this
checker is used for modernization, it is reasonable to run it on any C++
standard with the assumption the user is trying to modernize their
codebase"). To name some:

- LoopConvertCheck
- PassByValueCheck
- ReplaceAutoPtrCheck
- UseAutoCheck
- UseEmplaceCheck
- UseEqualsDefaultCheck
- UseEqualsDeleteCheck
- UseNullptrCheck

Others are applied only when the current C++ standard is high enough,
namely:

- RawStringLiteralCheck
- ReplaceRandomShuffleCheck
- ReturnBracedInitListCheck
- ShrinkToFitCheck
- UseDefaultMemberInitCheck
- UseNoexceptCheck
- UseOverrideCheck
- UseTransparentFunctorsCheck
- UseUsingCheck
- Make{Shared/Unique}Check

The first approach is causing troubles when with our clang-tidy integration
in CLion, since diagnostics are emitted on a perfectly valid C++03 code,
and applying FixIts breaks compilation. We could deal with it on our side,
blacklisting specific checks (or "modernize-*" altogether) with older
standards; however, we'd like to avoid knowing about specific checks on our
side when possible. Additionally,

- The situation is obviously inconsistent between different checks
- I don't see much sense for the user to try "to modernize their codebase"
when the user can't do anything with the results anyway

I'd like to go through the first group and require the C++11 standard for
them, what do you think?

+alex

Hello!

Currently some modernize-* checks in clang-tidy are applied regardless of the C++ standard used (some of them having comments like “Because this checker is used for modernization, it is reasonable to run it on any C++ standard with the assumption the user is trying to modernize their codebase”). To name some:

  • LoopConvertCheck
  • PassByValueCheck
  • ReplaceAutoPtrCheck

This might be an interesting one, if a standard lib removes auto_ptr with a reasonably recent compiler standard.
Not sure whether we have similar checks that could fix breaking changes.