Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[modularize] Use default member initialization for Location (NFC) #139384

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 10, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) clang-tools-extra/modularize/Modularize.cpp (+3-3)
diff --git a/clang-tools-extra/modularize/Modularize.cpp b/clang-tools-extra/modularize/Modularize.cpp
index 4bb3bae0503ac..734ee251c4f0b 100644
--- a/clang-tools-extra/modularize/Modularize.cpp
+++ b/clang-tools-extra/modularize/Modularize.cpp
@@ -381,11 +381,11 @@ getModularizeArgumentsAdjuster(DependencyMap &Dependencies) {
 // somewhere into Tooling/ in mainline
 struct Location {
   OptionalFileEntryRef File;
-  unsigned Line, Column;
+  unsigned Line = 0, Column = 0;
 
-  Location() : File(), Line(), Column() {}
+  Location() = default;
 
-  Location(SourceManager &SM, SourceLocation Loc) : File(), Line(), Column() {
+  Location(SourceManager &SM, SourceLocation Loc) {
     Loc = SM.getExpansionLoc(Loc);
     if (Loc.isInvalid())
       return;

@kazutakahirata kazutakahirata merged commit 0c83a0b into llvm:main May 10, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_default_ctor_Modularize_Location branch May 10, 2025 16:52
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