From e70b441290632e47cb5a122d0f7fd7301dd77b52 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Thu, 28 May 2015 18:57:35 +0000 Subject: [PATCH] ICU-10086 prevent warning or error from g++ -pedantic for extra semicolon after non-member function definition in U_DEFINE_LOCAL_OPEN_POINTER X-SVN-Rev: 37470 --- icu4c/source/common/unicode/localpointer.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/unicode/localpointer.h b/icu4c/source/common/unicode/localpointer.h index 87df956ca0b..a46a0d25d5f 100644 --- a/icu4c/source/common/unicode/localpointer.h +++ b/icu4c/source/common/unicode/localpointer.h @@ -538,7 +538,8 @@ inline void swap(LocalArray &p1, LocalArray &p2) U_NOEXCEPT { }; \ inline void swap(LocalPointerClassName &p1, LocalPointerClassName &p2) U_NOEXCEPT { \ p1.swap(p2); \ - } + } \ + class LocalPointerClassName #else #define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction) \ class LocalPointerClassName : public LocalPointerBase { \ @@ -563,8 +564,12 @@ inline void swap(LocalArray &p1, LocalArray &p2) U_NOEXCEPT { }; \ inline void swap(LocalPointerClassName &p1, LocalPointerClassName &p2) U_NOEXCEPT { \ p1.swap(p2); \ - } + } \ + class LocalPointerClassName #endif +// The trailing class forward declaration at the end of U_DEFINE_LOCAL_OPEN_POINTER +// prevents a warning or error from -pedantic compilation +// due to an extra ';' after the non-member swap function definition. U_NAMESPACE_END -- 2.40.0