From 66c5a35882f39cc5dee9835c4e9a4378dc916907 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index 971057bd29d584..10957f92d99b42 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -146,9 +146,9 @@ 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 /**