From 3b12162830c8b1c6c568325f8cd1648d636be047 Mon Sep 17 00:00:00 2001 From: PuQing Date: Wed, 14 Dec 2022 15:17:01 +0800 Subject: [PATCH] [CodeStyle] fix c++17-extensions warning on macos (#49017) * fix c++17-extensions warning on macos * fix type fix c++17-extensions warning on macos fix c++17-extensions warning on macos --- cmake/flags.cmake | 3 ++- paddle/phi/kernels/cpu/viterbi_decode_kernel.cc | 4 ++-- paddle/phi/kernels/strings/strings_lower_upper_kernel.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 6e18249b1a559..724d8185ec3bc 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -220,7 +220,8 @@ if(APPLE) -Werror=uninitialized -Werror=tautological-constant-out-of-range-compare -Werror=literal-conversion - -Werror=pragma-pack) + -Werror=pragma-pack + -Werror=c++17-extensions) endif() if(WITH_HETERPS AND WITH_PSLIB) diff --git a/paddle/phi/kernels/cpu/viterbi_decode_kernel.cc b/paddle/phi/kernels/cpu/viterbi_decode_kernel.cc index ae6bb5ae4fc55..c520963b172e4 100644 --- a/paddle/phi/kernels/cpu/viterbi_decode_kernel.cc +++ b/paddle/phi/kernels/cpu/viterbi_decode_kernel.cc @@ -110,7 +110,7 @@ struct Gather { template - typename CompareFunctor, + class CompareFunctor, typename T> struct GetMask { void operator()(const Context& dev_ctx, @@ -124,7 +124,7 @@ struct GetMask { template - typename BinaryFunctor, + class BinaryFunctor, typename T> struct BinaryOperation { void operator()(const Context& dev_ctx, diff --git a/paddle/phi/kernels/strings/strings_lower_upper_kernel.h b/paddle/phi/kernels/strings/strings_lower_upper_kernel.h index 36486bc3ec686..223ae4d9384d6 100644 --- a/paddle/phi/kernels/strings/strings_lower_upper_kernel.h +++ b/paddle/phi/kernels/strings/strings_lower_upper_kernel.h @@ -94,7 +94,7 @@ struct AsciiCaseConverter { template - typename CharConverter> + class CharConverter> struct UTF8CaseConverter { void operator()(const DeviceContext& dev_ctx, const pstring* in,