ralloc: Fully qualify non-virtual destructor call
authorKristian H. Kristensen <hoegsberg@google.com>
Thu, 18 Apr 2019 18:28:12 +0000 (11:28 -0700)
committerKristian H. Kristensen <hoegsberg@gmail.com>
Fri, 19 Apr 2019 16:17:37 +0000 (16:17 +0000)
This suppresses warning about calling a non-virtual destructor in a
non-final class with virtual functions:

src/compiler/glsl/ast.h:53:4: warning: destructor called on non-final 'ast_node' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
   DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(ast_node);

Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/util/ralloc.h

index 05ae8f8407c766089e22d7adbe473103f6ae531d..b4f372dfe9b00948ebf98caba30d573376e5836d 100644 (file)
@@ -430,7 +430,7 @@ bool ralloc_vasprintf_append(char **str, const char *fmt, va_list args);
 private:                                                                 \
    static void _ralloc_destructor(void *p)                               \
    {                                                                     \
-      reinterpret_cast<TYPE *>(p)->~TYPE();                              \
+      reinterpret_cast<TYPE *>(p)->TYPE::~TYPE();                        \
    }                                                                     \
 public:                                                                  \
    static void* operator new(size_t size, void *mem_ctx)                 \