Mercurial > octave
changeset 23423:50fc8edb007b
protect tree_unop and tree_array_list constructors
* pt-array-list.h, pt-unop.h: Make constructors private so these
classes may only be used as base classes.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 20 Apr 2017 12:27:35 -0400 |
parents | 206a7eb1561b |
children | 872f42fb26dc |
files | libinterp/parse-tree/pt-array-list.h libinterp/parse-tree/pt-unop.h |
diffstat | 2 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-array-list.h Fri Apr 21 20:26:33 2017 -0700 +++ b/libinterp/parse-tree/pt-array-list.h Thu Apr 20 12:27:35 2017 -0400 @@ -42,6 +42,8 @@ typedef octave::base_list<tree_argument_list *>::iterator iterator; typedef octave::base_list<tree_argument_list *>::const_iterator const_iterator; + protected: + tree_array_list (tree_argument_list *row = 0, int l = -1, int c = -1) : tree_expression (l, c), octave::base_list<tree_argument_list *> () { @@ -49,6 +51,8 @@ append (row); } + public: + // No copying! tree_array_list (const tree_array_list&) = delete;
--- a/libinterp/parse-tree/pt-unop.h Fri Apr 21 20:26:33 2017 -0700 +++ b/libinterp/parse-tree/pt-unop.h Thu Apr 20 12:27:35 2017 -0400 @@ -42,7 +42,7 @@ class tree_unary_expression : public tree_expression { - public: + protected: tree_unary_expression (int l = -1, int c = -1, octave_value::unary_op t @@ -54,6 +54,8 @@ = octave_value::unknown_unary_op) : tree_expression (l, c), op (e), etype (t) { } + public: + // No copying! tree_unary_expression (const tree_unary_expression&) = delete;