public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/49058] [C++0x] Bind no-arguments functor failed using std::bind with -pedantic option.
Date: Thu, 19 May 2011 15:59:00 -0000	[thread overview]
Message-ID: <bug-49058-4-GmtQrKMei2@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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2011.05.19 15:43:41
         AssignedTo|unassigned at gcc dot       |jason at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-19 15:43:41 UTC ---
This has nothing to do with variadics; the same error occurs with

template<typename T> T val();

struct F1
{   
    void operator()();
};

template<typename F>
struct Bind
{   
    template<typename R
      = decltype( val<F>()( ) )>
    R f();

    template<typename R
      = decltype( val<const F>()( ) )>
    R f() const;
};

int main()
{   
    Bind<F1>().f();
}

The problem is that F1::operator() is non-const, so when we instantiate
Bind<F1>, val<const F>() is ill-formed.  And this error is not dependent on  
EDG also rejects this testcase.  The bug is that we silently accept it without
-pedantic; we should be giving a pedwarn.


  parent reply	other threads:[~2011-05-19 15:57 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 [this message]
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
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-GmtQrKMei2@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).