Skip to content

[FileCheck] Use default member initialization in ExpressionFormat (NFC) #138409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 3, 2025

@llvm/pr-subscribers-testing-tools

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/138409.diff

1 Files Affected:

  • (modified) llvm/lib/FileCheck/FileCheckImpl.h (+2-2)
diff --git a/llvm/lib/FileCheck/FileCheckImpl.h b/llvm/lib/FileCheck/FileCheckImpl.h
index 4715fa9c64b61..b3cd2af5d57e3 100644
--- a/llvm/lib/FileCheck/FileCheckImpl.h
+++ b/llvm/lib/FileCheck/FileCheckImpl.h
@@ -51,7 +51,7 @@ struct ExpressionFormat {
   };
 
 private:
-  Kind Value;
+  Kind Value = Kind::NoFormat;
   unsigned Precision = 0;
   /// printf-like "alternate form" selected.
   bool AlternateForm = false;
@@ -78,7 +78,7 @@ struct ExpressionFormat {
   /// \returns the format specifier corresponding to this format as a string.
   StringRef toString() const;
 
-  ExpressionFormat() : Value(Kind::NoFormat){};
+  ExpressionFormat() = default;
   explicit ExpressionFormat(Kind Value) : Value(Value), Precision(0){};
   explicit ExpressionFormat(Kind Value, unsigned Precision)
       : Value(Value), Precision(Precision){};

@kazutakahirata kazutakahirata merged commit 7cc5e64 into llvm:main May 3, 2025
11 of 13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_default_member_init_ExpressionFormat branch May 3, 2025 17:27
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants