Skip to content

Commit

Permalink
[Clang] [NFC] Remove default argument in ASTUnit.h (#78566)
Browse files Browse the repository at this point in the history
This removes a default argument that is currently broken in C++23 mode
due to `std::default_delete` now being `constexpr`. This is a known
problem (see #74963, #59966, #69996, and a couple more), fixing which
will probably take some time, so this at least makes it possible to
compile `ASTUnit.h` in C++23 mode.

Note that we can’t simply include the header that provides the
definition of the class causing the problem either, as that would create
a circular dependency.
  • Loading branch information
Sirraide committed Jan 19, 2024
1 parent 9ad7d8f commit 061eb62
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Frontend/ASTUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ class ASTUnit {
SourceManager &SourceMgr, FileManager &FileMgr,
SmallVectorImpl<StoredDiagnostic> &StoredDiagnostics,
SmallVectorImpl<const llvm::MemoryBuffer *> &OwnedBuffers,
std::unique_ptr<SyntaxOnlyAction> Act = nullptr);
std::unique_ptr<SyntaxOnlyAction> Act);

/// Save this translation unit to a file with the given name.
///
Expand Down
3 changes: 2 additions & 1 deletion clang/tools/libclang/CIndexCodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ clang_codeCompleteAt_Impl(CXTranslationUnit TU, const char *complete_filename,
IncludeBriefComments, Capture,
CXXIdx->getPCHContainerOperations(), *Results->Diag,
Results->LangOpts, *Results->SourceMgr, *Results->FileMgr,
Results->Diagnostics, Results->TemporaryBuffers);
Results->Diagnostics, Results->TemporaryBuffers,
/*SyntaxOnlyAction=*/nullptr);

Results->DiagnosticsWrappers.resize(Results->Diagnostics.size());

Expand Down

0 comments on commit 061eb62

Please sign in to comment.