renatoGarcia / icecream-cpp

🍦 Never use cout/printf to debug again
Other
577 stars 29 forks source link

Functionalities in <codecvt> are deprecated since C++ 17/20 #28

Closed LyricZhao closed 3 months ago

LyricZhao commented 2 years ago

Some functionalities in <codecvt> (e.g. std::codecvt<char16_t, char, std::mbstate_t>) are being deprecated since C++ 17/20. Please refer to https://en.cppreference.com/w/cpp/locale/codecvt for more details. Compiling with these usages may throw annoying warnings.

LyricZhao commented 2 years ago

An easy way to ignore that is to add diagnostic pragmas around the entire implement:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

...

#pragma GCC diagnostic pop

Since Clang could recognize GCC, we just put GCC here in the pragmas.