public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/49058] [C++0x] Bind no-arguments functor failed using std::bind with -pedantic option.
Date: Sun, 22 May 2011 23:17:00 -0000	[thread overview]
Message-ID: <bug-49058-4-WMHRdjUoV4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49058-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49058

--- Comment #15 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-22 22:30:55 UTC ---
This is something which actually passes the testsuite, and the tests here and
the new test explained by Jon. Maybe something even more clean along the same
lines is possible, but I would be already pretty happy for now... assuming Jon
isn't able to figure out yet another regression ;)

////////////////////

Index: include/std/functional
===================================================================
--- include/std/functional    (revision 174044)
+++ include/std/functional    (working copy)
@@ -1210,7 +1210,8 @@

       // Call as const
       template<typename... _Args, typename _Result
-    = decltype( std::declval<const _Functor>()(
+    = decltype( std::declval<typename conditional<(sizeof...(_Args) >= 0),
+               typename add_const<_Functor>::type, void>::type>()(
           _Mu<_Bound_args>()( std::declval<const _Bound_args&>(),
                   std::declval<tuple<_Args...>&>() )... ) )>
     _Result
@@ -1223,7 +1224,8 @@

       // Call as volatile
       template<typename... _Args, typename _Result
-    = decltype( std::declval<volatile _Functor>()(
+    = decltype( std::declval<typename conditional<(sizeof...(_Args) >= 0),
+                       typename add_volatile<_Functor>::type, void>::type>()(
           _Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(),
                   std::declval<tuple<_Args...>&>() )... ) )>
     _Result
@@ -1236,7 +1238,8 @@

       // Call as const volatile
       template<typename... _Args, typename _Result
-    = decltype( std::declval<const volatile _Functor>()(
+    = decltype( std::declval<typename conditional<(sizeof...(_Args) >= 0),
+                       typename add_cv<_Functor>::type, void>::type>()(
           _Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(),
                   std::declval<tuple<_Args...>&>() )... ) )>
     _Result


  parent reply	other threads:[~2011-05-22 22:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-19  7:27 [Bug c++/49058] New: " flast at flast dot jp
2011-05-19 12:04 ` [Bug c++/49058] " redi at gcc dot gnu.org
2011-05-19 15:59 ` jason at gcc dot gnu.org
2011-05-19 16:23 ` jason at gcc dot gnu.org
2011-05-19 16:24 ` [Bug libstdc++/49058] " jason at gcc dot gnu.org
2011-05-19 16:37 ` jason at gcc dot gnu.org
2011-05-19 17:19 ` redi at gcc dot gnu.org
2011-05-22 21:02 ` paolo.carlini at oracle dot com
2011-05-22 21:45 ` redi at gcc dot gnu.org
2011-05-22 21:52 ` redi at gcc dot gnu.org
2011-05-22 21:53 ` redi at gcc dot gnu.org
2011-05-22 22:05 ` redi at gcc dot gnu.org
2011-05-22 22:10 ` paolo.carlini at oracle dot com
2011-05-22 22:35 ` paolo.carlini at oracle dot com
2011-05-22 22:51 ` paolo.carlini at oracle dot com
2011-05-22 23:17 ` paolo.carlini at oracle dot com [this message]
2011-05-22 23:47 ` paolo.carlini at oracle dot com
2011-05-23  0:02 ` redi at gcc dot gnu.org
2011-05-23  0:30 ` paolo at gcc dot gnu.org
2011-05-23  0:42 ` paolo.carlini at oracle dot com
2011-05-23  0:46 ` paolo.carlini at oracle dot com
2011-05-23  0:47 ` paolo at gcc dot gnu.org
2011-05-23 15:58 ` jason at gcc dot gnu.org
2011-05-25  0:05 ` paolo.carlini at oracle dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-49058-4-WMHRdjUoV4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).