This revision was automatically updated to reflect the committed changes.
Closed by commit rGa7bdaff7cad9: [clang-tidy] Implement
bugprone-incorrect-enable-if (authored by ccotter, committed by PiotrZSL).
Changed prior to commit:
https://reviews.llvm.org/D157239?vs=549777=552077#toc
PiotrZSL added a comment.
I'm pushing this, if you want to change anything else, just please open new
review.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157239/new/
https://reviews.llvm.org/D157239
PiotrZSL accepted this revision.
PiotrZSL added a comment.
This revision is now accepted and ready to land.
LGTM (+-)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157239/new/
https://reviews.llvm.org/D157239
ccotter marked an inline comment as done.
ccotter added a comment.
> Do you have plans to also detect the bugprone scenario described in the Notes
> here?
I didn't have plans in this review, or in the immediate future after. I did
name this check broadly as "bugprone-incorrect-enable-if," so I
ccotter marked an inline comment as done.
ccotter added inline comments.
Comment at:
clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp:61-62
+
+ FixItHint TypenameHint =
+ FixItHint::CreateInsertion(ElaboratedLoc->getBeginLoc(), "typename ");
+ FixItHint
ccotter updated this revision to Diff 549777.
ccotter marked 9 inline comments as done.
ccotter added a comment.
- Fix docs, handle C++20 simplification
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157239/new/
https://reviews.llvm.org/D157239
Eugene.Zelenko added inline comments.
Comment at:
clang-tools-extra/docs/clang-tidy/checks/bugprone/incorrect-enable-if.rst:6
+
+Detects incorrect usages of std::enable_if that don't name the nested 'type'
+type.
Please synchronize with statement in Release
carlosgalvezp added a comment.
Do you have plans to also detect the bugprone scenario described in the `Notes`
here?
https://en.cppreference.com/w/cpp/types/enable_if
No need to have it in this patch, but would be good to keep it in mind if we
want to add it in the future (preferably) or
ccotter added inline comments.
Comment at: clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp:67
+ diag(EnableIf->getBeginLoc(), "incorrect std::enable_if usage detected; use "
+"'typename std::enable_if<...>::type'")
+ <<
PiotrZSL added inline comments.
Comment at: clang-tools-extra/clang-tidy/bugprone/IncorrectEnableIfCheck.cpp:57
+
+ const SourceManager = Result.Context->getSourceManager();
+ SourceLocation RAngleLoc =
Result got source manager
ccotter updated this revision to Diff 547599.
ccotter added a comment.
- Edited wrong file
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157239/new/
https://reviews.llvm.org/D157239
Files:
ccotter created this revision.
Herald added subscribers: PiotrZSL, carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
ccotter requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.
Detects
12 matches
Mail list logo