[lldb] Disable warning about codecvt_utf8 deprecation (NFC) (#112446)
Disable -Wdeprecated-declarations for codecvt_utf8 in Editline. This is in preparation for #112276 which narrows the scope of -Wno-deprecated-declarations for building LLDB.
This commit is contained in:
committed by
GitHub
parent
92663defb1
commit
8c7f80f775
@@ -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 {
|
||||
|
||||
@@ -367,7 +384,9 @@ private:
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user