You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2018/12/15 00:14:53 UTC
kudu git commit: [client] clang: explicit override in C++11 mode only
Repository: kudu
Updated Branches:
refs/heads/master ce52b150e -> 7663c94db
[client] clang: explicit override in C++11 mode only
While playing with the Kudu C++ example application, I noticed that
clang emits a lot of compilation warnings about using the explicit
override for virtual methods. This patch addresses that, updating
the OVERRIDE macro to take into account the version of the C++ standard
the compiler is using while compiling a Kudu client application.
Change-Id: I2e11c6ce830e0b525a1b92af126f10de745c986a
Reviewed-on: http://gerrit.cloudera.org:8080/12093
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7663c94d
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7663c94d
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7663c94d
Branch: refs/heads/master
Commit: 7663c94db22cfadd1d2049b1c8f0128bf6fb4e4f
Parents: ce52b15
Author: Alexey Serbin <al...@apache.org>
Authored: Fri Dec 14 13:00:20 2018 -0800
Committer: Alexey Serbin <as...@cloudera.com>
Committed: Sat Dec 15 00:13:43 2018 +0000
----------------------------------------------------------------------
src/kudu/client/stubs.h | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/7663c94d/src/kudu/client/stubs.h
----------------------------------------------------------------------
diff --git a/src/kudu/client/stubs.h b/src/kudu/client/stubs.h
index e2d5105..0040b44 100644
--- a/src/kudu/client/stubs.h
+++ b/src/kudu/client/stubs.h
@@ -107,18 +107,21 @@ struct StubsCompileAssert {
// Use like:
// virtual void foo() OVERRIDE;
#ifndef OVERRIDE
-#if defined(COMPILER_MSVC)
-#define OVERRIDE override
-#elif defined(__clang__)
-#define OVERRIDE override
-#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
+# if defined(COMPILER_MSVC)
+# define OVERRIDE override
+# elif defined(__clang__) && __cplusplus >= 201103
+ // LLVM/Clang supports explicit virtual overrides, but warns about C++11
+ // extensions if compiling in pre-C++11 mode since the '-Wc++11-extensions'
+ // option is enabled by default.
+# define OVERRIDE override
+# elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700
-// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
-#define OVERRIDE override
-#else
-#define OVERRIDE
-#endif
-#endif
+ // GCC 4.7 supports explicit virtual overrides when C++11 support is enabled.
+# define OVERRIDE override
+# else
+# define OVERRIDE
+# endif
+#endif // #ifndef OVERRIDE
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \