From e5bdc9396090a72952e8cedddc17ac187f4075c2 Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Mon, 15 Feb 2021 22:50:57 -0500 Subject: [PATCH] Workaround to self move assign error with _GLIBCXX_DEBUG --- pch/main-pch.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pch/main-pch.hpp b/pch/main-pch.hpp index da8bf85e32157..05a3567076ce2 100644 --- a/pch/main-pch.hpp +++ b/pch/main-pch.hpp @@ -1,3 +1,15 @@ +// Workaround to a bug in libstdc++ prior to GCC 11 causing +// Error: attempt to self move assign. +// when compiling with _GLIBCXX_DEBUG +// see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85828 +#if defined(_GLIBCXX_DEBUG) && defined(__GNUC__) && (__GNUC__ < 11) +#include +#undef __glibcxx_check_self_move_assign +#define __glibcxx_check_self_move_assign(x) +#ifdef __glibcxx_check_self_move_assign // suppress unused macro warning +#endif +#endif + #include #include #include