aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-18 11:19:40 -0800
committerKrzysztof Parzyszek <kparzysz@quicinc.com>2022-12-18 11:23:54 -0800
commit205c0589f918f95d2f2c586a01bea2716d73d603 (patch)
tree38b2227ab6d17d7d189f32a23e5498404d45b634 /clang/lib/Sema/SemaModule.cpp
parenta538f7cfb1d71cd1a71b5b6d9fe8672a8b6d973e (diff)
downloadllvm-205c0589f918f95d2f2c586a01bea2716d73d603.zip
llvm-205c0589f918f95d2f2c586a01bea2716d73d603.tar.gz
llvm-205c0589f918f95d2f2c586a01bea2716d73d603.tar.bz2
Revert "[clang] Convert OptionalFileEntryRefDegradesToFileEntryPtr to std::optional"
This reverts commit 8f0df9f3bbc6d7f3d5cbfd955c5ee4404c53a75d. The Optional*RefDegradesTo*EntryPtr types want to keep the same size as the underlying type, which std::optional doesn't guarantee. For use with llvm::Optional, they define their own storage class, and there is no way to do that in std::optional. On top of that, that commit broke builds with older GCCs, where std::optional was not trivially copyable (static_assert in the clang sources was failing).
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 3383bdb..bb045760 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -15,7 +15,6 @@
#include "clang/Lex/HeaderSearch.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/SemaInternal.h"
-#include <optional>
using namespace clang;
using namespace sema;
@@ -321,7 +320,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc,
Diag(Path[0].second, diag::err_module_redefinition) << ModuleName;
if (M->DefinitionLoc.isValid())
Diag(M->DefinitionLoc, diag::note_prev_module_definition);
- else if (std::optional<FileEntryRef> FE = M->getASTFile())
+ else if (Optional<FileEntryRef> FE = M->getASTFile())
Diag(M->DefinitionLoc, diag::note_prev_module_definition_from_ast_file)
<< FE->getName();
Mod = M;