aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land.
LGTM! ================ Comment at: clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp:56-58 +AST_MATCHER(QualType, isLocalConstQualified) { + return Node.isLocalConstQualified(); +} ---------------- Izaron wrote: > aaron.ballman wrote: > > I think we might as well hit all the local qualifiers instead of just > > `const`, WDYT? e.g., `volatile` et al via `hasLocalQualifiers()` > In this case the checker will complain on this code: > ``` > const int i = 1; > volatile decltype(i) n() { > return 12345; > } > ``` > ``` > warning: return type 'volatile decltype(i)' (aka 'const volatile int') is > 'const'-qualified at the top level, which may reduce code readability without > improving const correctness [readability-const-return-type] > ``` > That wouldn't be the correct outcome. > > I added the test for the snippet above. Great, thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119470/new/ https://reviews.llvm.org/D119470 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits