This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-core-tests/utils/CompilerMacrosTest.cpp

40 lines
793 B
C++

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/Core_EXPORTS.h>
#include <aws/external/gtest.h>
AWS_DEPRECATED("Test a deprecated function")
static bool foo()
{
return true;
}
TEST(CompilerMacrosTest, TestCompilerMacro)
{
AWS_SUPPRESS_DEPRECATION(
bool ret = foo();
)
ASSERT_TRUE(ret);
#ifdef _MSC_VER
AWS_SUPPRESS_WARNING_PUSH(4201)
#else
AWS_SUPPRESS_WARNING_PUSH("-Wpedantic")
#endif
struct Test
{
union {
struct //compiler will give anonymous struct warning if warning is not suppressed
{
int a;
bool b;
};
char c[16];
};
};
AWS_SUPPRESS_WARNING_POP
}