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

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 13 06:49:42 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL363263: [clang-tidy] Fixed abseil-duration-unnecessary-conversion tests for c++17 (authored by gribozavr, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63263?vs=204519&id=204523#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63263/new/

https://reviews.llvm.org/D63263

Files:
  clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
  clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp


Index: clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
@@ -30,10 +30,9 @@
 
     // 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)`.
Index: clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
===================================================================
--- clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp
@@ -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"
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63263.204523.patch
Type: text/x-patch
Size: 1592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190613/376780ba/attachment.bin>


More information about the cfe-commits mailing list