public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/55861] New: [C++11] `std::shared_future::get' is not const-qualified
@ 2013-01-03 14:12 ai.azuma at gmail dot com
  2013-01-03 14:22 ` [Bug libstdc++/55861] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: ai.azuma at gmail dot com @ 2013-01-03 14:12 UTC (permalink / raw)
  To: gcc-bugs


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<R>::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 <future>

int f()
{
  return 42;
}

int main()
{
  std::shared_future<int> 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<int>' as 'this'
argument of 'const _Res& std::shared_future<_Res>::get() [with _Res = int]'
discards qualifiers [-fpermissive]
   ftr.get();
           ^


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-26 19:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-03 14:12 [Bug libstdc++/55861] New: [C++11] `std::shared_future::get' is not const-qualified ai.azuma at gmail dot com
2013-01-03 14:22 ` [Bug libstdc++/55861] " redi at gcc dot gnu.org
2013-01-19 23:43 ` redi at gcc dot gnu.org
2013-01-19 23:44 ` redi at gcc dot gnu.org
2013-09-26 19:04 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).