diff --git a/unittests/CppInterOp/VariableReflectionTest.cpp b/unittests/CppInterOp/VariableReflectionTest.cpp index 0bca0fd5c..6d0cbda37 100644 --- a/unittests/CppInterOp/VariableReflectionTest.cpp +++ b/unittests/CppInterOp/VariableReflectionTest.cpp @@ -93,14 +93,22 @@ TEST(VariableReflectionTest, GetVariableType) { #if __APPLE__ -#define maybeunused [[maybe_unused]] const int +#define CODE \ + int a; \ + [[maybe_unused]] const int N = 5; \ + class C { \ + public: \ + int a; \ + double b; \ + int *c; \ + int d; \ + static int s_a; \ + } c; \ + int C::s_a = 12; #else -typedef const int maybeunused; -#endif - #define CODE \ int a; \ - maybeunused N = 5; \ + const int N = 5; \ class C { \ public: \ int a; \ @@ -110,10 +118,8 @@ typedef const int maybeunused; static int s_a; \ } c; \ int C::s_a = 12; - -#if __APPLE__ -#undef maybeunused #endif + CODE TEST(VariableReflectionTest, GetVariableOffset) {