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"
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"
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits