[ASTMatchers] Migrate away from ArrayRef(std::nullopt) (NFC) (#145840)

ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

This patch migrates away from std::nullopt in favor of ArrayRef<T>().
Note that {} would be ambiguous for perfect forwarding to work here.
This commit is contained in:
Kazu Hirata
2025-06-26 08:40:47 -07:00
committed by GitHub
parent 620dbf1fec
commit a13cf846e0

View File

@@ -1060,7 +1060,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(), StringRef MatcherName) {
BuildReturnTypeVector<ReturnType>::build(RetTypes);
return std::make_unique<FixedArgCountMatcherDescriptor>(
matcherMarshall0<ReturnType>, reinterpret_cast<void (*)()>(Func),
MatcherName, RetTypes, std::nullopt);
MatcherName, RetTypes, ArrayRef<ArgKind>());
}
/// 1-arg overload