From 9d2f571ccbca2a81e4a9a4b55dc9cec326879517 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Sun, 12 Sep 2021 21:40:43 -0400 Subject: [PATCH] Fix ChipError scope resolution Make sure to unambiguously specify the chip namespace in macros as they can be evaluated in places where 'chip::' is ambiguous. --- src/lib/core/CHIPError.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 971057bd29d584..c4a7d63fd86157 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -146,9 +146,10 @@ class ChipError * (In C++20 this could be replaced by a consteval constructor.) */ #if CHIP_CONFIG_ERROR_SOURCE -#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(chip::ChipError::SdkErrorConstant<(part), (code)>::value, __FILE__, __LINE__)) +#define CHIP_SDK_ERROR(part, code) \ + (::chip::ChipError(::chip::ChipError::SdkErrorConstant<(part), (code)>::value, __FILE__, __LINE__)) #else // CHIP_CONFIG_ERROR_SOURCE -#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(chip::ChipError::SdkErrorConstant<(part), (code)>::value)) +#define CHIP_SDK_ERROR(part, code) (::chip::ChipError(::chip::ChipError::SdkErrorConstant<(part), (code)>::value)) #endif // CHIP_CONFIG_ERROR_SOURCE /**