diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy')
-rw-r--r-- | clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp index 535dd5c8b45..6fbc885e0a4 100644 --- a/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp +++ b/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp @@ -124,15 +124,12 @@ public: // changed the header guard or not. if (!FixIts.empty()) { if (CurHeaderGuard != NewGuard) { - auto D = Check->diag(Ifndef, - "header guard does not follow preferred style"); - for (FixItHint &Fix : FixIts) - D.AddFixItHint(std::move(Fix)); + Check->diag(Ifndef, "header guard does not follow preferred style") + << FixIts; } else { - auto D = Check->diag(EndIf, "#endif for a header guard should " - "reference the guard macro in a comment"); - for (FixItHint &Fix : FixIts) - D.AddFixItHint(std::move(Fix)); + Check->diag(EndIf, "#endif for a header guard should reference the " + "guard macro in a comment") + << FixIts; } } } |