Repository navigation
[clang-doc] Remove unused simple_ilist comparison operators (NFC) - #206309
Merged
Merged
Conversation
These operator== and operator!= templates were never called, so they trip -Wunused-template. Remove the dead code.
|
@llvm/pr-subscribers-clang-tools-extra Author: Aditya Medhane (flash1729) ChangesThese operator== and operator!= templates in YAMLGenerator.cpp were never called. They went in as infrastructure that never got wired up, and a later static cleanup exposed them under -Wunused-template. Remove the dead code. NFC. Part of #202945. 1 Files Affected:
diff --git a/clang-tools-extra/clang-doc/YAMLGenerator.cpp b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
index 5a1d822526daa..7ccf526c59e22 100644
--- a/clang-tools-extra/clang-doc/YAMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/YAMLGenerator.cpp
@@ -32,24 +32,6 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(BaseRecordInfo)
namespace llvm {
-template <typename T>
-static bool operator==(const llvm::simple_ilist<T> &LHS,
- const llvm::simple_ilist<T> &RHS) {
- auto LIt = LHS.begin(), LEnd = LHS.end();
- auto RIt = RHS.begin(), REnd = RHS.end();
- for (; LIt != LEnd && RIt != REnd; ++LIt, ++RIt) {
- if (!(*LIt == *RIt))
- return false;
- }
- return LIt == LEnd && RIt == REnd;
-}
-
-template <typename T>
-static bool operator!=(const llvm::simple_ilist<T> &LHS,
- const llvm::simple_ilist<T> &RHS) {
- return !(LHS == RHS);
-}
-
namespace yaml {
// Provide SequenceTraits for ArrayRef<T*> since YAMLTraits only provides it for
|
Member
Author
ilovepi
approved these changes
Jun 28, 2026
ilovepi
left a comment
Contributor
There was a problem hiding this comment.
LGTM if the bots are happy with this. Thanks for catching and fixing the issue.
@evelez7 any progress on dropping YAML/legacy MD implementation? The legacy implementations are becoming problematic, as we're not really maintaining them appropriately.
LouisLu060211
pushed a commit
to LouisLu060211/llvm-project
that referenced
this pull request
Jun 30, 2026
…vm#206309) These operator== and operator!= templates in YAMLGenerator.cpp were never called. They went in as infrastructure that never got wired up, and now a cleanup exposed them under -Wunused-template. Remove the dead code. NFC. Part of llvm#202945.
maarcosrmz
pushed a commit
to maarcosrmz/llvm-project
that referenced
this pull request
Jul 1, 2026
…vm#206309) These operator== and operator!= templates in YAMLGenerator.cpp were never called. They went in as infrastructure that never got wired up, and now a cleanup exposed them under -Wunused-template. Remove the dead code. NFC. Part of llvm#202945.
vgvassilev
pushed a commit
that referenced
this pull request
Jul 6, 2026
Uncomment `UnusedTemplate` in the `Unused` diagnostic group so `-Wunused-template` becomes part of `-Wall`. `-Wunused-template` flags unused function and variable templates with internal linkage. In a header, such a template gives every translation unit its own internal-linkage copy, which is a latent ODR violation (ill-formed, no diagnostic required), so enabling this surfaces a real class of bugs and keeps the pattern from reappearing. ### Depends on The in-tree occurrences were cleaned up first in a series of NFC PRs tracked by #202945. This change only builds clean once those land, so CI will be red on any area whose cleanup is not yet merged. Remaining prerequisites: Approved - #202969 - #202971 - #202973 - #202974 - #206309 - #206312 Needs to be reviewed - #202988 - #206308 Closes #202945 cc @AaronBallman @vgvassilev
gandhi56
pushed a commit
that referenced
this pull request
Jul 9, 2026
Uncomment `UnusedTemplate` in the `Unused` diagnostic group so `-Wunused-template` becomes part of `-Wall`. `-Wunused-template` flags unused function and variable templates with internal linkage. In a header, such a template gives every translation unit its own internal-linkage copy, which is a latent ODR violation (ill-formed, no diagnostic required), so enabling this surfaces a real class of bugs and keeps the pattern from reappearing. ### Depends on The in-tree occurrences were cleaned up first in a series of NFC PRs tracked by #202945. This change only builds clean once those land, so CI will be red on any area whose cleanup is not yet merged. Remaining prerequisites: Approved - #202969 - #202971 - #202973 - #202974 - #206309 - #206312 Needs to be reviewed - #202988 - #206308 Closes #202945 cc @AaronBallman @vgvassilev
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.
These operator== and operator!= templates in YAMLGenerator.cpp were never called. They went in as infrastructure that never got wired up, and now a cleanup exposed them under -Wunused-template. Remove the dead code.
NFC. Part of #202945.