From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26305 invoked by alias); 15 Nov 2012 04:46:39 -0000 Received: (qmail 26266 invoked by uid 48); 15 Nov 2012 04:46:22 -0000 From: "ai.azuma at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55335] New: [DR 5] cv-qualifiers of destination type in copy-initialization Date: Thu, 15 Nov 2012 04:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ai.azuma at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg01368.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55335 Bug #: 55335 Summary: [DR 5] cv-qualifiers of destination type in copy-initialization Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: ai.azuma@gmail.com Created attachment 28694 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28694 Output of -v option and preprocessed file with GCC 4.8.0 20121111 The following valid code is rejected by GCC 4.6.4 20121109, 4.7.3 20121110 and 4.8.0 20121111. ///////////////////////// struct C{}; struct A { A(const A&){}; A(const C&){}; }; int main() { C c; const volatile A a = c; } ///////////////////////// For the above code, GCC 4.8.0 20121111 complains as follows; main.cpp: In function 'int main()': main.cpp:11:24: error: no matching function for call to 'A::A(const volatile A)' const volatile A a = c; ^ main.cpp:11:24: note: candidates are: main.cpp:5:3: note: A::A(const C&) A(const C&){}; ^ main.cpp:5:3: note: no known conversion for argument 1 from 'const volatile A' to 'const C&' main.cpp:4:3: note: A::A(const A&) A(const A&){}; ^ main.cpp:4:3: note: no known conversion for argument 1 from 'const volatile A' to 'const A&' As far as I can guess from the error message, GCC does not seem to implement the proposed resolution of DR 5. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#5