[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-21 Thread Piotr Zegar via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-21 Thread Piotr Zegar via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-14 Thread Piotr Zegar via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-13 Thread Chris Cotter via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-13 Thread Chris Cotter via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-13 Thread Chris Cotter via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Eugene Zelenko via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Carlos Galvez via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Chris Cotter via Phabricator via cfe-commits
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'") + <<

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Piotr Zegar via Phabricator via cfe-commits
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

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Chris Cotter via Phabricator via cfe-commits
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:

[PATCH] D157239: [clang-tidy] Implement bugprone-incorrect-enable-if

2023-08-06 Thread Chris Cotter via Phabricator via cfe-commits
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