[clang-tools-extra] 09c1b2e - [clang-tidy][NFC] Fix cppcoreguidelines-prefer-member-initializer findings

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 27 01:53:32 PDT 2023


Author: Piotr Zegar
Date: 2023-08-27T08:52:09Z
New Revision: 09c1b2e141d06f293e150b890165713213e397bc

URL: https://github.com/llvm/llvm-project/commit/09c1b2e141d06f293e150b890165713213e397bc
DIFF: https://github.com/llvm/llvm-project/commit/09c1b2e141d06f293e150b890165713213e397bc.diff

LOG: [clang-tidy][NFC] Fix cppcoreguidelines-prefer-member-initializer findings

Fix issues found by clang-tidy in clang-tidy source directory.

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
index fa7285744be890..d8c7c52ba89ace 100644
--- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp
@@ -1952,13 +1952,12 @@ struct FormattedConversionSequence {
   /// The formatted sequence is trivial if it is "Ty1 -> Ty2", but Ty1 and
   /// Ty2 are the types that are shown in the code. A trivial diagnostic
   /// does not need to be printed.
-  bool Trivial;
+  bool Trivial = true;
 
   FormattedConversionSequence(const PrintingPolicy &PP,
                               StringRef StartTypeAsDiagnosed,
                               const model::ConversionSequence &Conv,
                               StringRef DestinationTypeAsDiagnosed) {
-    Trivial = true;
     llvm::raw_string_ostream OS{DiagnosticText};
 
     // Print the type name as it is printed in other places in the diagnostic.


        


More information about the cfe-commits mailing list