Skip to content

Commit a13cf84

Browse files
[ASTMatchers] Migrate away from ArrayRef(std::nullopt) (NFC) (llvm#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.
1 parent 620dbf1 commit a13cf84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/ASTMatchers/Dynamic/Marshallers.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ makeMatcherAutoMarshall(ReturnType (*Func)(), StringRef MatcherName) {
10601060
BuildReturnTypeVector<ReturnType>::build(RetTypes);
10611061
return std::make_unique<FixedArgCountMatcherDescriptor>(
10621062
matcherMarshall0<ReturnType>, reinterpret_cast<void (*)()>(Func),
1063-
MatcherName, RetTypes, std::nullopt);
1063+
MatcherName, RetTypes, ArrayRef<ArgKind>());
10641064
}
10651065

10661066
/// 1-arg overload

0 commit comments

Comments
 (0)