Skip to content

Commit 8d11673

Browse files
committed
Fix the SubCommands find_if return type.
1 parent dfc592e commit 8d11673

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Option/OptTable.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,11 +756,12 @@ void OptTable::internalPrintHelp(
756756
// pairs.
757757
std::map<std::string, std::vector<OptionInfo>> GroupedOptionHelp;
758758

759-
const auto ActiveSubCommand =
759+
typename ArrayRef<OptTable::SubCommand>::iterator ActiveSubCommand =
760760
std::find_if(SubCommands.begin(), SubCommands.end(),
761761
[&](const auto &C) { return SubCommand == C.Name; });
762762
if (!SubCommand.empty()) {
763-
assert(ActiveSubCommand != nullptr && "Not a valid registered subcommand.");
763+
assert(ActiveSubCommand != SubCommands.end() &&
764+
"Not a valid registered subcommand.");
764765
OS << ActiveSubCommand->HelpText << "\n\n";
765766
if (!StringRef(ActiveSubCommand->Usage).empty())
766767
OS << "USAGE: " << ActiveSubCommand->Usage << "\n\n";

0 commit comments

Comments
 (0)