From eae85ad1557f4b2537e9de37ae4fd117ed66e19f Mon Sep 17 00:00:00 2001 From: Zijun Date: Mon, 10 Jun 2024 19:45:33 +0000 Subject: [PATCH] Fix anonymous class error Fail to compile bionic/tests/complex_test.cpp when updating compiler due to the conflict. Bug: b/346349678 Test: change the clang version and then run mm to build Change-Id: Ic22b7325b6e52006e620e13944f3f1d76030d782 --- tests/complex_test.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/complex_test.cpp b/tests/complex_test.cpp index 6a1831f78..8fdb2b2e1 100644 --- a/tests/complex_test.cpp +++ b/tests/complex_test.cpp @@ -32,7 +32,11 @@ #include // For M_PI_2/M_PI_2l. // Prettify gtest Complex printing. +// Macro 'complex' defined in complex.h conflicts with iostream. +#pragma push_macro("complex") +#undef complex #include +#pragma pop_macro("complex") namespace testing { namespace internal { inline void PrintTo(const double _Complex& c, std::ostream* os) {