bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/8] tests: fix -Wdeprecated warning


From: Akim Demaille
Subject: [PATCH 1/8] tests: fix -Wdeprecated warning
Date: Sun, 27 May 2018 10:55:28 +0200

With recent compilers:

    input.yy:49:5: error: definition of implicit copy assignment
                          operator for 'Object' is deprecated because
                          it has a user-declared destructor
                          [-Werror,-Wdeprecated]
        ~Object ()
        ^
    input.yy:130:35: note: in implicit copy assignment operator for
                           'Object' first required here
        { yylhs.value.as< Object > () = yystack_[0].value.as< Object > (); }

* tests/c++.at (Object): Add missing assignment operator.
---
 tests/c++.at | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/c++.at b/tests/c++.at
index a7878650..d708a5ba 100644
--- a/tests/c++.at
+++ b/tests/c++.at
@@ -770,6 +770,12 @@ $1
       Object::instances.erase (i);
     }
 
+    Object& operator= (const Object& that)
+    {
+      val = that.val;
+      return *this;
+    }
+
     Object& operator= (char v)
     {
       val = v;
-- 
2.17.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]