Drop redundant typename (C++20 P0634) - #281
Merged
Merged
Conversation
helly25
force-pushed
the
clang_tidy_redundant_typename
branch
from
August 9, 2026 15:11
d12d227 to
5d98158
Compare
helly25
enabled auto-merge (squash)
August 9, 2026 16:01
33 findings across 14 files, all in dependent-type contexts where C++20 no longer requires the keyword: alias declarations, member declarations, and `requires`-clause parameter lists. Applied with clang-tidy's own fixes, exported per TU and merged with clang-apply-replacements rather than running --fix in parallel, so the headers shared by many TUs could not be written concurrently. Unlike misc-const-correctness, this check's fixes ARE safe here: every changed line is a bare keyword removal, verified by reading the whole diff. The keyword remains valid where written, so this is a readability change rather than a correctness one - and the relaxed rules are C++20, which is this project's baseline, so the GCC best-effort build is unaffected (its support predates the baseline). readability-redundant-typename now reports zero. bazel test --config=clang //... - 109/109 pass. Signed-off-by: helly25 <6420169+helly25@users.noreply.github.com>
helly25
force-pushed
the
clang_tidy_redundant_typename
branch
from
August 9, 2026 16:31
1fbdb66 to
78ea3a7
Compare
Fab-Cat
approved these changes
Aug 9, 2026
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.
Clears all 33
readability-redundant-typenamefindings across 14 files.What
C++20 (P0634R3, "Down with
typename!") removed the requirement fortypenamein contexts where only a type can appear. These are all such contexts — alias declarations, member declarations, andrequires-clause parameter lists:The keyword stays valid where it was written, so this is a readability change, not a correctness one. The relaxed rules are C++20, which is this project's baseline (
--cxxopt=-std=c++20), so the best-effort GCC build is unaffected — its support predates the baseline.Method
Applied with clang-tidy's own fixes, exported per TU with
--export-fixesand merged once viaclang-apply-replacements, rather than running--fixin parallel across 81 TUs that share headers.Unlike
misc-const-correctnessin #275 — where the auto-fix broke the build three different ways — this check's fixes are safe here. I verified that by reading the entire diff: all 66 changed lines are bare keyword removals, with no other edit of any kind.Test
readability-redundant-typenamereports zero across the affected files.bazel test --config=clang //...— 109/109 pass.pre-commit run -agreen.