From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5375 invoked by alias); 3 Jan 2013 14:12:08 -0000 Received: (qmail 5267 invoked by uid 48); 3 Jan 2013 14:11:41 -0000 From: "ai.azuma at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/55861] New: [C++11] `std::shared_future::get' is not const-qualified Date: Thu, 03 Jan 2013 14:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ 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: 2013-01/txt/msg00174.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55861 Bug #: 55861 Summary: [C++11] `std::shared_future::get' is not const-qualified Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: ai.azuma@gmail.com `std::shared_future::get' member function is specified as const-qualified in [futures.shared_future]. However, libstdc++'s implementation is not. A testcase would be as follows; //-------------------------------------------------- #include int f() { return 42; } int main() { std::shared_future const ftr(std::async(&f)); ftr.get(); // Line 11 } //-------------------------------------------------- For the above testcase, GCC 4.8.0 20121230 complains as follows; main.cpp: In function 'int main()': main.cpp:11:11: error: passing 'const std::shared_future' as 'this' argument of 'const _Res& std::shared_future<_Res>::get() [with _Res = int]' discards qualifiers [-fpermissive] ftr.get(); ^