[llvm][docs] Replace Optional<T> with std::optional<T>

The `llvm::Optional` template is no more. Remove it from the error-handling section of LLVM the programmer's manual and the ASTImporter documentation.
This commit is contained in:
Jan Svoboda
2025-04-17 13:17:52 -07:00
parent 91c2607aac
commit cdad39b7e0
2 changed files with 3 additions and 3 deletions

View File

@@ -468,7 +468,7 @@ Note, there may be several different ASTImporter objects which import into the s
cxxRecordDecl(hasName("Y"), isDefinition()), ToUnit);
ToYDef->dump();
// An error is set for "ToYDef" in the shared state.
Optional<ASTImportError> OptErr =
std::optional<ASTImportError> OptErr =
ImporterState->getImportDeclErrorIfAny(ToYDef);
assert(OptErr);

View File

@@ -590,14 +590,14 @@ semantics. For example:
This third form works with any type that can be assigned to from ``T&&``. This
can be useful if the ``Expected<T>`` value needs to be stored an already-declared
``Optional<T>``. For example:
``std::optional<T>``. For example:
.. code-block:: c++
Expected<StringRef> extractClassName(StringRef Definition);
struct ClassData {
StringRef Definition;
Optional<StringRef> LazyName;
std::optional<StringRef> LazyName;
...
Error initialize() {
if (auto Err = extractClassName(Path).moveInto(LazyName))