mirror of
https://github.com/apple/swift.git
synced 2026-11-30 09:15:01 +01:00
```
unittests/AST/DiagnosticConsumerTests.cpp:70:12: note: in instantiation of function template specialization 'std::make_unique<(anonymous namespace)::ExpectationDiagnosticConsumer, std::nullptr_t, const std::nullopt_t &, 0>' requested here
70 | std::make_unique<ExpectationDiagnosticConsumer>(nullptr, std::nullopt);
| ^
unittests/AST/DiagnosticConsumerTests.cpp:29:5: note: candidate constructor not viable: no known conversion from 'const std::nullopt_t' to 'ArrayRef<ExpectedDiagnostic>' (aka 'ArrayRef<Located<StringRef>>') for 2nd argument
29 | ExpectationDiagnosticConsumer(ExpectationDiagnosticConsumer *previous,
| ^
```
The offending commit removed the deprecated ArrayRef(std::nullopt_t)
constructor, so passing std::nullopt where an empty ArrayRef is expected
no longer compiles. Replace the std::nullopt arguments with an
explicitly-typed empty ArrayRef<ExpectedDiagnostic>(); a braced {} cannot
be used here because the arguments are forwarded through std::make_unique
and would not be deducible.
See https://github.com/llvm/llvm-project/commit/cfbb4cc31215d615f605466aef0bcfb42aa9faa5 (https://github.com/llvm/llvm-project/pull/165831)
Assisted-by: Claude Code