alexfh requested changes to this revision.
alexfh added a comment.
This revision now requires changes to proceed.
Should the check be in "bugprone-" instead?
https://reviews.llvm.org/D33470
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
aaron.ballman added inline comments.
Comment at: test/clang-tidy/misc-default-numerics.cpp:28
+struct numeric_limits {
+ static int min() { return -1; }
+ static SpecializedType max() { return SpecializedType(); }
This is not a proper specialization according t
Prazek updated this revision to Diff 104297.
Prazek added a comment.
fixed broken test
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsCheck.cpp
clang-tidy/misc/DefaultNumericsCheck.h
clang-tidy/misc/MiscTidyModule.cpp
docs/ReleaseN
Prazek updated this revision to Diff 104288.
Prazek added a comment.
Small fix
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsCheck.cpp
clang-tidy/misc/DefaultNumericsCheck.h
clang-tidy/misc/MiscTidyModule.cpp
docs/ReleaseNotes.rst
Prazek updated this revision to Diff 104281.
Prazek marked 2 inline comments as done.
Prazek added a comment.
Herald added a subscriber: JDevlieghere.
- fixed docs
- fixes
- Last fixes?
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsChec
Prazek added a comment.
In https://reviews.llvm.org/D33470#790484, @aaron.ballman wrote:
> In https://reviews.llvm.org/D33470#789791, @Prazek wrote:
>
> > In https://reviews.llvm.org/D33470#764846, @aaron.ballman wrote:
> >
> > > Once you fix the typo in the check, can you run it over some large
aaron.ballman added a comment.
In https://reviews.llvm.org/D33470#789791, @Prazek wrote:
> In https://reviews.llvm.org/D33470#764846, @aaron.ballman wrote:
>
> > Once you fix the typo in the check, can you run it over some large C++ code
> > bases to see if it finds any results?
>
>
> I tried it
Prazek added a comment.
In https://reviews.llvm.org/D33470#764846, @aaron.ballman wrote:
> Once you fix the typo in the check, can you run it over some large C++ code
> bases to see if it finds any results?
I tried it on LLVM code base (after fixing bug with the numeric_limits name)
and it di
Prazek updated this revision to Diff 103837.
Prazek marked 4 inline comments as done.
Prazek added a comment.
- fixed docs
- fixes
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsCheck.cpp
clang-tidy/misc/DefaultNumericsCheck.h
clang-
alexshap added inline comments.
Comment at: clang-tidy/misc/DefaultNumericsCheck.h:20
+/// This check flags usages of ``std::numeric_limits::{min,max}()`` for
+/// unspecialized types. It is dangerous because it returns T(), which might is
+/// rarely minimum or maximum for this
aaron.ballman added a comment.
Once you fix the typo in the check, can you run it over some large C++ code
bases to see if it finds any results?
Comment at: clang-tidy/misc/DefaultNumericsCheck.cpp:30
+ ofClass(classTemplateSpecializationDecl(
+ h
Prazek updated this revision to Diff 100216.
Prazek marked 8 inline comments as done.
Prazek added a comment.
- Thanks for the review Aaron, that is much better.
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsCheck.cpp
clang-tidy/misc/
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/DefaultNumericsCheck.cpp:37
+void DefaultNumericsCheck::check(const MatchFinder::MatchResult &Result) {
+
+ const auto *MatchedDecl = Result.Nodes.getNodeAs("call");
Can remove the spurious newline
Prazek updated this revision to Diff 100070.
Prazek added a comment.
- fixed docs
https://reviews.llvm.org/D33470
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/DefaultNumericsCheck.cpp
clang-tidy/misc/DefaultNumericsCheck.h
clang-tidy/misc/MiscTidyModule.cpp
docs/ReleaseNotes.
Prazek added inline comments.
Comment at: docs/clang-tidy/checks/misc-default-numerics.rst:11
+Consider scenario:
+1. Have `typedef long long BigInt` in source code
+2. Use `std::numeric_limits::min()`
Eugene.Zelenko wrote:
> May be code-block will be better?
Rig
Eugene.Zelenko added inline comments.
Comment at: docs/clang-tidy/checks/misc-default-numerics.rst:11
+Consider scenario:
+1. Have `typedef long long BigInt` in source code
+2. Use `std::numeric_limits::min()`
May be code-block will be better?
https://reviews.l
Prazek created this revision.
Herald added subscribers: xazax.hun, mgorny.
This check flags usages of ``std::numeric_limits::{min,max}()`` for
unspecialized types. It is dangerous because returns T(), which might is
rarely
minimum or maximum for this type.
Consider scenario:
1. Have `typedef lon
17 matches
Mail list logo