[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
- [PATCH 0/8] maint: fix more warnings, Akim Demaille, 2018/05/27
- [PATCH 1/8] tests: fix -Wdeprecated warning,
Akim Demaille <=
- [PATCH 3/8] C++: style: space before paren, Akim Demaille, 2018/05/27
- [PATCH 4/8] C++: style: prefer `unsigned` to `unsigned int`, Akim Demaille, 2018/05/27
- [PATCH 5/8] NEWS: update, Akim Demaille, 2018/05/27
- [PATCH 6/8] C++: style: fix indentation, Akim Demaille, 2018/05/27
- [PATCH 2/8] C++: fix -Wdeprecated warnings, Akim Demaille, 2018/05/27
- [PATCH 8/8] regen, Akim Demaille, 2018/05/27
- [PATCH 7/8] bison: please address sanitizer, Akim Demaille, 2018/05/27