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 2026/09/10 15:00:00 UTC

(kudu) 02/02: [misc] fix compilation warnings with GCC-15 on CWG #2237

This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit d06637b2775c9786e7b955076af7982a1fae426a
Author: Alexey Serbin <al...@apache.org>
AuthorDate: Wed Sep 9 14:24:42 2026 -0700

    [misc] fix compilation warnings with GCC-15 on CWG #2237
    
    Since GCC-15 implemented the resolution on CWG Issue 2237 [1], there
    was a flood of warnings like below when compiling with GCC-15.  This
    changelist addresses the issue.
    
      src/kudu/gutil/macros.h:98:11: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
         98 |   TypeName(const TypeName&) = delete;      \
            |           ^
      src/kudu/gutil/ref_counted.h:102:3: note: in expansion of macro ‘DISALLOW_COPY_AND_ASSIGN’
        102 |   DISALLOW_COPY_AND_ASSIGN(RefCounted<T>);
            |   ^~~~~~~~~~~~~~~~~~~~~~~~
      src/kudu/gutil/macros.h:98:11: note: remove the ‘< >’
    
    This changelist doesn't contain any functional modifications.
    
    [1] https://cplusplus.github.io/CWG/issues/2237.html
    
    Change-Id: Idb863c8cf547d6da79489944269f0c257de7411b
    Reviewed-on: http://gerrit.cloudera.org:8080/24809
    Tested-by: Kudu Jenkins
    Reviewed-by: Zoltan Martonka <zm...@cloudera.com>
---
 src/kudu/common/key_encoder.cc |  2 +-
 src/kudu/gutil/ref_counted.h   |  2 +-
 src/kudu/gutil/stl_util.h      | 16 ++++++++--------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/kudu/common/key_encoder.cc b/src/kudu/common/key_encoder.cc
index 72aeb7f53..723f520c6 100644
--- a/src/kudu/common/key_encoder.cc
+++ b/src/kudu/common/key_encoder.cc
@@ -43,7 +43,7 @@ class EncoderResolver final {
   }
 
  private:
-  EncoderResolver<Buffer>() {
+  EncoderResolver() {
     AddMapping<UINT8>();
     AddMapping<INT8>();
     AddMapping<UINT16>();
diff --git a/src/kudu/gutil/ref_counted.h b/src/kudu/gutil/ref_counted.h
index a347fd65d..b80e6c159 100644
--- a/src/kudu/gutil/ref_counted.h
+++ b/src/kudu/gutil/ref_counted.h
@@ -99,7 +99,7 @@ class RefCounted : public subtle::RefCountedBase {
   ~RefCounted() {}
 
  private:
-  DISALLOW_COPY_AND_ASSIGN(RefCounted<T>);
+  DISALLOW_COPY_AND_ASSIGN(RefCounted);
 };
 
 // Forward declaration.
diff --git a/src/kudu/gutil/stl_util.h b/src/kudu/gutil/stl_util.h
index 50f9bf327..1e06f9a9c 100644
--- a/src/kudu/gutil/stl_util.h
+++ b/src/kudu/gutil/stl_util.h
@@ -433,11 +433,11 @@ class BaseDeleter {
 template<class STLContainer>
 class TemplatedElementDeleter : public BaseDeleter {
  public:
-  explicit TemplatedElementDeleter<STLContainer>(STLContainer *ptr)
+  explicit TemplatedElementDeleter(STLContainer *ptr)
       : container_ptr_(ptr) {
   }
 
-  ~TemplatedElementDeleter<STLContainer>() override {
+  ~TemplatedElementDeleter() override {
     STLDeleteElements(container_ptr_);
   }
 
@@ -473,11 +473,11 @@ class ElementDeleter {
 template<class STLContainer>
 class TemplatedValueDeleter : public BaseDeleter {
  public:
-  explicit TemplatedValueDeleter<STLContainer>(STLContainer *ptr)
+  explicit TemplatedValueDeleter(STLContainer *ptr)
       : container_ptr_(ptr) {
   }
 
-  ~TemplatedValueDeleter<STLContainer>() override {
+  ~TemplatedValueDeleter() override {
     STLDeleteValues(container_ptr_);
   }
 
@@ -516,16 +516,16 @@ class ValueDeleter {
 
 template<class STLContainer> class STLElementDeleter {
  public:
-  STLElementDeleter<STLContainer>(STLContainer *ptr) : container_ptr_(ptr) {}
-  ~STLElementDeleter<STLContainer>() { STLDeleteElements(container_ptr_); }
+  STLElementDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
+  ~STLElementDeleter() { STLDeleteElements(container_ptr_); }
  private:
   STLContainer *container_ptr_;
 };
 
 template<class STLContainer> class STLValueDeleter {
  public:
-  STLValueDeleter<STLContainer>(STLContainer *ptr) : container_ptr_(ptr) {}
-  ~STLValueDeleter<STLContainer>() { STLDeleteValues(container_ptr_); }
+  STLValueDeleter(STLContainer *ptr) : container_ptr_(ptr) {}
+  ~STLValueDeleter() { STLDeleteValues(container_ptr_); }
  private:
   STLContainer *container_ptr_;
 };