It cannot match a pure virtual function. This patch fixes this behavior.
Details
Diff Detail
Event Timeline
FYI: I'm from Bytedance Inc, @Sockke, and I are fixing the AutoFix bugs recently, most of them will lead to the compilation error. For this bug, fixing the override virtual methods but missing the pure virtual base method, which will cause the compilation error. These annoying bugs will hinder the large-scale deployment of clang-tidy AutoFix in the production environment.
clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp | ||
---|---|---|
101 | Like @flx comments in https://reviews.llvm.org/D116593, the better choice is that we suppress the fix for the virtual method. What do you think @Sockke? |
clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp | ||
---|---|---|
101 | I agree that the fix needs to be suppressed here as well, for the same reasons as the quoted review. e.g., https://godbolt.org/z/Yvsb37Yzr |
LGTM aside from a nit; can you also add a release note about the fix to clang-tools-extra/docs/ReleaseNotes.rst?
clang-tools-extra/clang-tidy/readability/ConstReturnTypeCheck.cpp | ||
---|---|---|
122 |
Like @flx comments in https://reviews.llvm.org/D116593, the better choice is that we suppress the fix for the virtual method. What do you think @Sockke?