From 674355a0976dfedc871562fc567125acc5cf87bf Mon Sep 17 00:00:00 2001 From: Zeng Jinle <32832641+sneaxiy@users.noreply.github.com> Date: Thu, 9 Apr 2020 22:44:16 -0500 Subject: [PATCH] fix GET_DATA_SAFELY ptr, test=develop (#23679) --- paddle/fluid/platform/enforce.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index 09aa27898e4..99f83d97320 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -394,8 +394,8 @@ struct EnforceNotMet : public std::exception { */ #define GET_DATA_SAFELY(__PTR, __ROLE, __NAME, __OP_TYPE) \ (([&]() -> std::add_lvalue_reference::type { \ - auto* ptr = (__PTR); \ - if (UNLIKELY(nullptr == ptr)) { \ + auto* __ptr = (__PTR); \ + if (UNLIKELY(nullptr == __ptr)) { \ __THROW_ERROR_INTERNAL__( \ "%s\n [Hint: pointer " #__PTR " should not be null.]", \ paddle::platform::errors::NotFound( \ @@ -405,13 +405,13 @@ struct EnforceNotMet : public std::exception { " 2. The %s has no corresponding variable passed in;\n" \ " 3. The %s corresponding variable is not initialized.", \ paddle::platform::demangle( \ - typeid(std::add_lvalue_reference::type) \ + typeid(std::add_lvalue_reference::type) \ .name()), \ __ROLE, __NAME, __OP_TYPE, __NAME, __ROLE, __OP_TYPE, __NAME, \ __NAME) \ .ToString()); \ } \ - return *ptr; \ + return *__ptr; \ })()) /* -- GitLab