Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 22 additions & 0 deletions lldb/include/lldb/Host/Editline.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@

#include "llvm/ADT/FunctionExtras.h"

#if defined(__clang__) && defined(__has_warning)
#if __has_warning("-Wimplicit-fallthrough")
#define EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define RESTORE_DEPRECATED_DECLARATION_WARNINGS _Pragma("clang diagnostic pop")
#endif
#elif defined(__GNUC__) && __GNUC__ > 6
#define EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define RESTORE_DEPRECATED_DECLARATION_WARNINGS _Pragma("GCC diagnostic pop")
#endif
#ifndef EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS
#define EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS
#endif
#ifndef EL_RESTORE_DEPRECATED_DECLARATION_WARNINGS
#define EL_RESTORE_DEPRECATED_DECLARATION_WARNINGS
#endif

namespace lldb_private {
namespace line_editor {

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

#if LLDB_EDITLINE_USE_WCHAR
EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS
std::wstring_convert<std::codecvt_utf8<wchar_t>> m_utf8conv;
EL_RESTORE_DEPRECATED_DECLARATION_WARNINGS
#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
EL_DISABLE_DEPRECATED_DECLARATION_WARNINGS
std::codecvt_utf8<wchar_t> cvt;
EL_RESTORE_DEPRECATED_DECLARATION_WARNINGS
llvm::SmallString<4> input;
for (;;) {
const char *from_next;
Expand Down