mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-14 23:10:54 +00:00
[clang-tidy] google-runtime-int: made the matcher more restricting, added a test for a false positive
This should be NFC. llvm-svn: 247806
This commit is contained in:
parent
5ef13dc8bd
commit
4d48e1e85b
@ -36,7 +36,7 @@ void IntegerTypesCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
|
||||
void IntegerTypesCheck::registerMatchers(MatchFinder *Finder) {
|
||||
// Find all TypeLocs. The relevant Style Guide rule only applies to C++.
|
||||
if (getLangOpts().CPlusPlus)
|
||||
Finder->addMatcher(typeLoc().bind("tl"), this);
|
||||
Finder->addMatcher(typeLoc(loc(isInteger())).bind("tl"), this);
|
||||
}
|
||||
|
||||
void IntegerTypesCheck::check(const MatchFinder::MatchResult &Result) {
|
||||
|
@ -49,6 +49,7 @@ short bar(const short, unsigned short) {
|
||||
|
||||
tmpl<short>();
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:8: warning: consider replacing 'short' with 'int16'
|
||||
return 0;
|
||||
}
|
||||
|
||||
void p(unsigned short port);
|
||||
@ -57,3 +58,10 @@ void qux() {
|
||||
short port;
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: consider replacing 'short' with 'int16'
|
||||
}
|
||||
|
||||
// FIXME: This shouldn't warn, as UD-literal operators require one of a handful
|
||||
// of types as an argument.
|
||||
struct some_value {};
|
||||
constexpr some_value operator"" _some_literal(unsigned long long int i);
|
||||
// CHECK-MESSAGES: [[@LINE-1]]:47: warning: consider replacing 'unsigned long long'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user