[clang-tools-extra] r363263 - [clang-tidy] Fixed abseil-duration-unnecessary-conversion tests for c++17
Dmitri Gribenko via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 13 06:52:45 PDT 2019
Author: gribozavr
Date: Thu Jun 13 06:52:45 2019
New Revision: 363263
URL: http://llvm.org/viewvc/llvm-project?rev=363263&view=rev
Log:
[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.
Modified:
clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
Modified: clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp?rev=363263&r1=363262&r2=363263&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp Thu Jun 13 06:52:45 2019
@@ -30,10 +30,9 @@ void DurationUnnecessaryConversionCheck:
// 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)`.
Modified: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp?rev=363263&r1=363262&r2=363263&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp (original)
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp Thu Jun 13 06:52:45 2019
@@ -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"
More information about the cfe-commits
mailing list