Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions lldb/include/lldb/Host/Editline.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@

#include "llvm/ADT/FunctionExtras.h"

#if defined(__clang__) && defined(__has_warning)
#if __has_warning("-Wdeprecated-declarations")
#define LLDB_DEPRECATED_WARNING_DISABLE \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define LLDB_DEPRECATED_WARNING_RESTORE _Pragma("clang diagnostic pop")
#endif
#elif defined(__GNUC__) && __GNUC__ > 6
#define LLDB_DEPRECATED_WARNING_DISABLE \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define LLDB_DEPRECATED_WARNING_RESTORE _Pragma("GCC diagnostic pop")
#else
#define LLDB_DEPRECATED_WARNING_DISABLE
#define LLDB_DEPRECATED_WARNING_RESTORE
#endif

namespace lldb_private {
namespace line_editor {

Expand Down Expand Up @@ -367,7 +384,9 @@ class Editline {
void SetGetCharacterFunction(EditlineGetCharCallbackType callbackFn);

#if LLDB_EDITLINE_USE_WCHAR
LLDB_DEPRECATED_WARNING_DISABLE
std::wstring_convert<std::codecvt_utf8<wchar_t>> m_utf8conv;
LLDB_DEPRECATED_WARNING_RESTORE
#endif
::EditLine *m_editline = nullptr;
EditlineHistorySP m_history_sp;
Expand Down
2 changes: 2 additions & 0 deletions lldb/source/Host/common/Editline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,9 @@ bool Editline::CompleteCharacter(char ch, EditLineGetCharType &out) {
out = (unsigned char)ch;
return true;
#else
LLDB_DEPRECATED_WARNING_DISABLE
std::codecvt_utf8<wchar_t> cvt;
LLDB_DEPRECATED_WARNING_RESTORE
llvm::SmallString<4> input;
for (;;) {
const char *from_next;
Expand Down