Author: rtrieu Date: Wed Apr 25 16:50:55 2018 New Revision: 330887 URL: http://llvm.org/viewvc/llvm-project?rev=330887&view=rev Log: Switch to Clang's isDigit function.
std::isdigit can be overloaded, causing the template deduction to fail. Use Clang's isDigit function which to avoid this. Switch the other calls for consistency. Modified: cfe/trunk/lib/Driver/ToolChains/Arch/RISCV.cpp Modified: cfe/trunk/lib/Driver/ToolChains/Arch/RISCV.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/RISCV.cpp?rev=330887&r1=330886&r2=330887&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Arch/RISCV.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Arch/RISCV.cpp Wed Apr 25 16:50:55 2018 @@ -8,13 +8,13 @@ //===----------------------------------------------------------------------===// #include "RISCV.h" +#include "clang/Basic/CharInfo.h" #include "clang/Driver/Driver.h" #include "clang/Driver/DriverDiagnostic.h" #include "clang/Driver/Options.h" #include "llvm/Option/ArgList.h" #include "llvm/Support/TargetParser.h" #include "llvm/Support/raw_ostream.h" -#include <cctype> using namespace clang::driver; using namespace clang::driver::tools; @@ -57,7 +57,7 @@ static bool getExtensionVersion(const Dr auto I = In.begin(); auto E = In.end(); - while (I != E && isdigit(*I)) + while (I != E && isDigit(*I)) Major.append(1, *I++); if (Major.empty()) @@ -66,7 +66,7 @@ static bool getExtensionVersion(const Dr if (I != E && *I == 'p') { ++I; - while (I != E && isdigit(*I)) + while (I != E && isDigit(*I)) Minor.append(1, *I++); // Expected 'p' to be followed by minor version number. @@ -161,7 +161,7 @@ static void getExtensionFeatures(const D } std::string Major, Minor; - auto Pos = Name.find_if(std::isdigit); + auto Pos = Name.find_if(isDigit); if (Pos != StringRef::npos) { auto Next = Name.substr(Pos); Name = Name.substr(0, Pos); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits