From dda960dce42e7547a62939e9b10d9f9538350629 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Mon, 28 Mar 2022 05:48:58 +0200 Subject: [PATCH] Use default copy-constructor for LineInfo The LineInfo class defines a copy-constructor, but relies on the default copy-assignment operator. In newer versions of C++ this deprecated and modern compilers generate a warning about this. A class must either use the default copy-constructor and default copy-assignment operator or provide a user defined version of both. Since the current user-defined copy-constructor for LineInfo does the same as the default copy-constructor, remove the custom one and rely on the default constructor. Signed-off-by: Lars-Peter Clausen --- libmisc/LineInfo.cc | 5 ----- libmisc/LineInfo.h | 1 - 2 files changed, 6 deletions(-) diff --git a/libmisc/LineInfo.cc b/libmisc/LineInfo.cc index c0daaff14..753b24970 100644 --- a/libmisc/LineInfo.cc +++ b/libmisc/LineInfo.cc @@ -27,11 +27,6 @@ LineInfo::LineInfo() { } -LineInfo::LineInfo(const LineInfo&that) : - file_(that.file_), lineno_(that.lineno_) -{ -} - LineInfo::~LineInfo() { } diff --git a/libmisc/LineInfo.h b/libmisc/LineInfo.h index ec36aee41..b47f194f0 100644 --- a/libmisc/LineInfo.h +++ b/libmisc/LineInfo.h @@ -34,7 +34,6 @@ class LineInfo { public: LineInfo(); - LineInfo(const LineInfo&that); virtual ~LineInfo(); // Get a fully formatted file/lineno