Skip to content

Commit

Permalink
[clang] Use 'starts_with' instead of 'startswith' in Gnu.cpp (NFC)
Browse files Browse the repository at this point in the history
llvm-project/clang/lib/Driver/ToolChains/Gnu.cpp:1757:14:
 error: 'startswith' is deprecated: Use starts_with instead [-Werror,-Wdeprecated-declarations]
 1757 |     if (Flag.startswith("!march=") || Flag.startswith("-march="))
      |              ^~~~~~~~~~
      |              starts_with
  • Loading branch information
DamonFool committed Dec 18, 2023
1 parent ca10343 commit c7cdf3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChains/Gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ selectRISCVMultilib(const MultilibSet &RISCVMultilibSet, StringRef Arch,

// Collect all flags except march=*
for (StringRef Flag : Flags) {
if (Flag.startswith("!march=") || Flag.startswith("-march="))
if (Flag.starts_with("!march=") || Flag.starts_with("-march="))
continue;

NewFlags.push_back(Flag.str());
Expand Down

0 comments on commit c7cdf3c

Please sign in to comment.