This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Calling non-trivial default copy constructors (c++/2065)


Since a few days I have started getting the following error from the
3.0-branch g++:

$ /usr/local/src/gnu/gcc-2.97/install/bin/g++ -Wunused-parameter x.C -c
x.C: In method `C::C(const C&)':
x.C:1: warning: unused parameter `const C&_ctor_arg'

where the file x.C is

class C {
public:
  virtual ~C();
};

class D : public C {
public:
  D(const D&);
};

D::D(const D& d) : C(d) { }

Please note that the warning goes away if either
* D::D(const D&) is made inline
* C contains no virtual methods

I do consider this a little bit annoying, does anyone have an idea about
what to do about it?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]