Skip to content

Commit b33e730

Browse files
jansvoboda11IanWood1
authored andcommitted
[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.
1 parent 8334c3c commit b33e730

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

clang/docs/LibASTImporter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ Note, there may be several different ASTImporter objects which import into the s
468468
cxxRecordDecl(hasName("Y"), isDefinition()), ToUnit);
469469
ToYDef->dump();
470470
// An error is set for "ToYDef" in the shared state.
471-
Optional<ASTImportError> OptErr =
471+
std::optional<ASTImportError> OptErr =
472472
ImporterState->getImportDeclErrorIfAny(ToYDef);
473473
assert(OptErr);
474474

llvm/docs/ProgrammersManual.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,14 +590,14 @@ semantics. For example:
590590

591591
This third form works with any type that can be assigned to from ``T&&``. This
592592
can be useful if the ``Expected<T>`` value needs to be stored an already-declared
593-
``Optional<T>``. For example:
593+
``std::optional<T>``. For example:
594594

595595
.. code-block:: c++
596596

597597
Expected<StringRef> extractClassName(StringRef Definition);
598598
struct ClassData {
599599
StringRef Definition;
600-
Optional<StringRef> LazyName;
600+
std::optional<StringRef> LazyName;
601601
...
602602
Error initialize() {
603603
if (auto Err = extractClassName(Path).moveInto(LazyName))

0 commit comments

Comments
 (0)