[flang] Add missing symbol names to the error message#148888
Merged
eugeneepshteyn merged 2 commits intollvm:mainfrom Jul 16, 2025
Merged
[flang] Add missing symbol names to the error message#148888eugeneepshteyn merged 2 commits intollvm:mainfrom
eugeneepshteyn merged 2 commits intollvm:mainfrom
Conversation
Contributor
Author
|
New output: There are already semantic tests that check for this error, they are just checking the first error line. |
klausler
approved these changes
Jul 15, 2025
Member
|
@llvm/pr-subscribers-flang-semantics Author: Eugene Epshteyn (eugeneepshteyn) ChangesFixes #140485 Full diff: https://github.com/llvm/llvm-project/pull/148888.diff 1 Files Affected:
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 96faa5fd954cd..b3268605e7c0c 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -8574,8 +8574,10 @@ bool ResolveNamesVisitor::Pre(const parser::ImportStmt &x) {
} else {
Say(name,
"A distinct '%s' is already present in this scope"_err_en_US)
- .Attach(symbol->name(), "Previous declaration of '%s'"_en_US)
- .Attach(outer->name(), "Declaration of '%s' in host scope"_en_US);
+ .Attach(symbol->name(), "Previous declaration of '%s'"_en_US,
+ symbol->name().ToString())
+ .Attach(outer->name(), "Declaration of '%s' in host scope"_en_US,
+ outer->name().ToString());
}
}
} else {
|
akuhlens
approved these changes
Jul 15, 2025
Contributor
akuhlens
left a comment
There was a problem hiding this comment.
LGTM, one improvement might be to add a test that checks the error message.
This was referenced Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #140485