[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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user