[Mesa-dev,2/4] glsl: make ast_node destructor virtual

Submitted by Rob Herring on May 30, 2017, 8:47 p.m.

Details

Message ID 20170530204709.17221-2-robh@kernel.org
State New
Headers show
Series "Series without cover letter" ( rev: 2 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Rob Herring May 30, 2017, 8:47 p.m.
Make ast_node destructor virtual to fix the following clang warning:

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

Signed-off-by: Rob Herring <robh@kernel.org>
---
 src/compiler/glsl/ast.h | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
index 9327e0397935..5515dabf0504 100644
--- a/src/compiler/glsl/ast.h
+++ b/src/compiler/glsl/ast.h
@@ -50,6 +50,8 @@  class ast_node {
 public:
    DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(ast_node);
 
+   virtual ~ast_node() {};
+
    /**
     * Print an AST node in something approximating the original GLSL code
     */

Comments

This patch is

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

On 05/30/2017 01:47 PM, Rob Herring wrote:
> Make ast_node destructor virtual to fix the following clang warning:
> 
> src/compiler/glsl/ast.h:51:4: warning: destructor called on non-final 'ast_node' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  src/compiler/glsl/ast.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
> index 9327e0397935..5515dabf0504 100644
> --- a/src/compiler/glsl/ast.h
> +++ b/src/compiler/glsl/ast.h
> @@ -50,6 +50,8 @@ class ast_node {
>  public:
>     DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(ast_node);
>  
> +   virtual ~ast_node() {};
> +
>     /**
>      * Print an AST node in something approximating the original GLSL code
>      */
>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

On 05/31/2017 03:05 AM, Ian Romanick wrote:
> This patch is
> 
> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
> 
> On 05/30/2017 01:47 PM, Rob Herring wrote:
>> Make ast_node destructor virtual to fix the following clang warning:
>>
>> src/compiler/glsl/ast.h:51:4: warning: destructor called on non-final 'ast_node' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
>>
>> Signed-off-by: Rob Herring <robh@kernel.org>
>> ---
>>   src/compiler/glsl/ast.h | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/src/compiler/glsl/ast.h b/src/compiler/glsl/ast.h
>> index 9327e0397935..5515dabf0504 100644
>> --- a/src/compiler/glsl/ast.h
>> +++ b/src/compiler/glsl/ast.h
>> @@ -50,6 +50,8 @@ class ast_node {
>>   public:
>>      DECLARE_LINEAR_ZALLOC_CXX_OPERATORS(ast_node);
>>   
>> +   virtual ~ast_node() {};
>> +
>>      /**
>>       * Print an AST node in something approximating the original GLSL code
>>       */
>>
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>