Project

General

Profile

Actions

Bug #12139

closed

make: definition of implicit copy constructor is deprecated

Added by Toomas Soome almost 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

Build error with gcc 9. The description about the background is https://en.cppreference.com/w/cpp/language/rule_of_three

    In file included from /code/illumos-gate/usr/src/cmd/make/include/mksh/i18n.h:28,
                     from /code/illumos-gate/usr/src/cmd/make/lib/mksh/i18n.cc:36:
    /code/illumos-gate/usr/src/cmd/make/include/mksh/defs.h: In member function 'Name_set::iterator Name_set::iterator::operator++(int)':
    /code/illumos-gate/usr/src/cmd/make/include/mksh/defs.h:823:46: error: implicitly-declared 'constexpr Name_set::iterator::iterator(const Name_set::iterator&)' is deprecated [-Werror=deprecated-copy]
      823 |   iterator  operator++(int) { iterator it = *this; ++*this; return it; }
          |                                              ^~~~
    /code/illumos-gate/usr/src/cmd/make/include/mksh/defs.h:815:13: note: because 'Name_set::iterator' has user-provided 'Name_set::iterator& Name_set::iterator::operator=(const Name_set::iterator&)'
      815 |   iterator& operator=(const iterator &o) { node = o.node; return *this; }
          |             ^~~~~~~~
    /code/illumos-gate/usr/src/cmd/make/include/mksh/defs.h:823:68: error: implicitly-declared 'constexpr Name_set::iterator::iterator(const Name_set::iterator&)' is deprecated [-Werror=deprecated-copy]
      823 |   iterator  operator++(int) { iterator it = *this; ++*this; return it; }
          |                                                                    ^~
    /code/illumos-gate/usr/src/cmd/make/include/mksh/defs.h:815:13: note: because 'Name_set::iterator' has user-provided 'Name_set::iterator& Name_set::iterator::operator=(const Name_set::iterator&)'
      815 |   iterator& operator=(const iterator &o) { node = o.node; return *this; }
          |             ^~~~~~~~
    cc1plus: all warnings being treated as errors

Add default constructor, so we will not get the generated default silently reduced in future compiler version (this is why the warning is injected).

Actions #1

Updated by Electric Monk almost 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 50d967713af8725306d090dd29033d9efe924715

commit  50d967713af8725306d090dd29033d9efe924715
Author: Toomas Soome <tsoome@me.com>
Date:   2020-01-10T07:23:18.000Z

    12139 make: definition of implicit copy constructor is deprecated
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: C Fraire <cfraire@me.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF