[clang-tidy] Fixed abseil-duration-unnecessary-conversion tests for c++17

Summary: Fixed abseil-duration-unnecessary-conversion tests for c++17

Reviewers: hokein, gribozavr

Reviewed By: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63263

Patch by Johan Vikström.

llvm-svn: 363263
This commit is contained in:
Dmitri Gribenko 2019-06-13 13:52:45 +00:00
parent 31d68804fd
commit ab240c5eee
2 changed files with 3 additions and 5 deletions

View File

@ -30,10 +30,9 @@ void DurationUnnecessaryConversionCheck::registerMatchers(MatchFinder *Finder) {
// Matcher which matches the current scale's factory with a `1` argument,
// e.g. `absl::Seconds(1)`.
auto factory_matcher = cxxConstructExpr(hasArgument(
0,
auto factory_matcher = ignoringElidableConstructorCall(
callExpr(callee(functionDecl(hasName(DurationFactory))),
hasArgument(0, ignoringImpCasts(integerLiteral(equals(1)))))));
hasArgument(0, ignoringImpCasts(integerLiteral(equals(1))))));
// Matcher which matches either inverse function and binds its argument,
// e.g. `absl::ToDoubleSeconds(dur)`.

View File

@ -1,5 +1,4 @@
// RUN: %check_clang_tidy -std=c++11,c++14 %s abseil-duration-unnecessary-conversion %t -- -- -I %S/Inputs
// FIXME: Fix the checker to work in C++17 mode.
// RUN: %check_clang_tidy -std=c++11-or-later %s abseil-duration-unnecessary-conversion %t -- -- -I %S/Inputs
#include "absl/time/time.h"