[Bug c++/44313] g++ no longer warns about private copy constructors
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313 --- Comment #7 from Jonathan Wakely --- And for completeness, the docs have been updated: Starting with GCC 4.3.0, GCC no longer gives an error for this case. This change is based on the intent of the C++ language committee. As of 2010-05-28, the final proposed draft of the C++0x standard permits this code without error. I wonder if we should just remove that whole section, nobody cares about GCC 4.2.x now. I think I proposed a patch years ago to rip that whole section out, but it never happened.
[Bug c++/44313] g++ no longer warns about private copy constructors
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313 Jonathan Wakely changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #6 from Jonathan Wakely --- (In reply to Ian Lance Taylor from comment #1) > This was addressed as a DR by the C++ committee: > http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391 . And of > course the proposed C++0x standard removes this error. So gcc should only > give an error with -std=c++98 -pedantic. This is low priority. Our policy is to implement defect report resolutions in all dialects they apply to. We don't implement a buggy standard even if you say -std=c++98 -pedantic. So not a bug.
[Bug c++/44313] g++ no longer warns about private copy constructors
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313 Eric Gallager changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2018-12-13 Ever confirmed|0 |1 --- Comment #5 from Eric Gallager --- (In reply to Ian Lance Taylor from comment #0) > Our very own web page has a C++ FAQ about requires that a copy constructor > be visible when initializing a const reference: > http://gcc.gnu.org/bugs/#cxx_rvalbind > > However, current versions of gcc do not give an error for that code, even > when using -pedantic -std=c++98. The last version of gcc to give the error > was gcc 4.2. This seems ironic considering that we say "most popular > compilers do not correctly implement this rule." > > I think we should give that error when -pedantic. Confirmed that there is still no error: $ cat 44313.cc class A { public: A(); private: A(const A&); // private copy ctor }; A makeA(void); void foo(const A&); void bar(void) { foo(A()); // error, copy ctor is not accessible foo(makeA()); // error, copy ctor is not accessible A a1; foo(a1);// OK, a1 is a lvalue } $ /usr/local/bin/gcc -c -Wall -Wextra -pedantic -Weffc++ -std=c++98 44313.cc $ (silence)
[Bug c++/44313] g++ no longer warns about private copy constructors
--- Comment #2 from pinskia at gcc dot gnu dot org 2010-07-24 21:56 --- As far as I understand we decided that CD1 resolution Defect reports are going to be implemented as part of C++03/C++98. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313
[Bug c++/44313] g++ no longer warns about private copy constructors
--- Comment #3 from pinskia at gcc dot gnu dot org 2010-07-24 21:57 --- See PR 25950 which is the bug report which implemented that defect report. I think we should just remove the paragraph from the web page or at least reference we now implement that defect report. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313
[Bug c++/44313] g++ no longer warns about private copy constructors
--- Comment #4 from pinskia at gcc dot gnu dot org 2010-07-24 22:02 --- See also http://gcc.gnu.org/ml/gcc-patches/2007-10/msg01386.html: When the rvalue references patch went in, DR391 was partially implemented, but only for C++0x mode. This seems wrong to me; if the committee has decided that the standard was wrong, it seems perverse for us to cling to the letter of the standard when users are clamoring for us to change our behavior. C++0x mode makes some sense for controlling new language features, but not for DRs. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313
[Bug c++/44313] g++ no longer warns about private copy constructors
--- Comment #1 from ian at airs dot com 2010-05-28 14:30 --- This was addressed as a DR by the C++ committee: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#391 . And of course the proposed C++0x standard removes this error. So gcc should only give an error with -std=c++98 -pedantic. This is low priority. -- ian at airs dot com changed: What|Removed |Added Severity|normal |minor http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44313