From 6a627e3e98c468a7652d79eedfb141ed11ffb8c5 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sun, 10 Nov 2019 21:04:29 +0100 Subject: COMMON: Fix very noisy warning when building with GCC 9 in C++11 mode --- common/rational.cpp | 5 +++++ common/rational.h | 1 + 2 files changed, 6 insertions(+) diff --git a/common/rational.cpp b/common/rational.cpp index 90e44576a7..84c1e4bee0 100644 --- a/common/rational.cpp +++ b/common/rational.cpp @@ -51,6 +51,11 @@ Rational::Rational(int num, int denom) { cancel(); } +Rational::Rational(const Rational &rational) { + _num = rational._num; + _denom = rational._denom; +} + void Rational::cancel() { // Cancel the fraction by dividing both the num and the denom // by their greatest common divisor. diff --git a/common/rational.h b/common/rational.h index 89caaf25b4..bd240c99f3 100644 --- a/common/rational.h +++ b/common/rational.h @@ -34,6 +34,7 @@ public: Rational(); Rational(int num); Rational(int num, int denom); + Rational(const Rational &rational); Rational &operator=(const Rational &right); Rational &operator=(int right); -- cgit v1.2.3