public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bkoz@gcc.gnu.org
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
	rkbr@oce.nl
Subject: Re: libstdc++/6230: Using not1() from std_function.h causes ICE
Date: Tue, 09 Apr 2002 00:58:00 -0000	[thread overview]
Message-ID: <20020409075849.17589.qmail@sources.redhat.com> (raw)

Synopsis: Using not1() from std_function.h causes ICE

State-Changed-From-To: open->analyzed
State-Changed-By: bkoz
State-Changed-When: Tue Apr  9 00:58:48 2002
State-Changed-Why:
    Here's the useful bit:
    
    #include <algorithm>
    #include <list>
    #include <functional>
    
    class Foo 
    {
    public:
      int myvar;
    public:
      Foo (int v) { myvar = v; }
      class lt 
      {
      private:
        int bound;
      public:
        lt(const int b) :bound(b) { }
        bool operator() (const Foo & foo) 
        { return foo.myvar < bound; }
      };
    };
    
    int main (void)
    {
      using namespace std;
      list<Foo> l;
      for (int i = 0; i < 100; i++) 
        l.push_back(Foo(i));
      remove_if( l.begin(), l.end(), not1( Foo::lt(50) ) );
      return 0;
    }
    
    
    on gcc-3.1-20020409 it gives:
    
    6230.cc: In instantiation of `std::unary_negate<Foo::lt>':
    6230.cc:28:   instantiated from here
    6230.cc:28: no type named `argument_type' in `class Foo::lt'
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_function.h:278: no
       type named `argument_type' in `class Foo::lt'
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h: In
       function `_OutputIter std::remove_copy_if(_InputIter, _InputIter, 
       _OutputIter, _Predicate) [with _InputIter = std::_List_iterator<Foo, Foo&, 
       Foo*>, _OutputIter = std::_List_iterator<Foo, Foo&, Foo*>, _Predicate = 
       std::unary_negate<Foo::lt>]':
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:1085:   instantiated from `_ForwardIter std::remove_if(_ForwardIter, _ForwardIter, _Predicate) [with _ForwardIter = std::_List_iterator<Foo, Foo&, Foo*>, _Predicate = std::unary_negate<Foo::lt>]'
    6230.cc:28:   instantiated from here
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:1016: no
       match for call to `(std::unary_negate<Foo::lt>) (Foo&)'
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h: In
       function `_InputIter std::find_if(_InputIter, _InputIter, _Predicate, 
       std::input_iterator_tag) [with _InputIter = std::_List_iterator<Foo, Foo&, 
       Foo*>, _Predicate = std::unary_negate<Foo::lt>]':
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:318:   instantiated from `_InputIter std::find_if(_InputIter, _InputIter, _Predicate) [with _InputIter = std::_List_iterator<Foo, Foo&, Foo*>, _Predicate = std::unary_negate<Foo::lt>]'
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:1083:   instantiated from `_ForwardIter std::remove_if(_ForwardIter, _ForwardIter, _Predicate) [with _ForwardIter = std::_List_iterator<Foo, Foo&, Foo*>, _Predicate = std::unary_negate<Foo::lt>]'
    6230.cc:28:   instantiated from here
    /mnt/hd/ahimsa/bld-x86-gcc/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algo.h:188: no
       match for call to `(std::unary_negate<Foo::lt>) (Foo&)'

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6230


             reply	other threads:[~2002-04-09  7:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-09  0:58 bkoz [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-05-31 18:46 pme
2002-04-08  7:56 rkbr

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=20020409075849.17589.qmail@sources.redhat.com \
    --to=bkoz@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    --cc=rkbr@oce.nl \
    /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).