public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/67617] New: Non-standard const requirements imposed on associate container comparison objects
@ 2015-09-17 19:12 mdempsky at google dot com
  2015-09-26 17:24 ` [Bug libstdc++/67617] Non-standard const requirements imposed on associative " daniel.kruegler at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mdempsky at google dot com @ 2015-09-17 19:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67617

            Bug ID: 67617
           Summary: Non-standard const requirements imposed on associate
                    container comparison objects
           Product: gcc
           Version: 4.8.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mdempsky at google dot com
  Target Milestone: ---

This code appears to me to be conforming to the C++ standard, but it's rejected
by G++/libstdc++:

    #include <set>
    struct compare {
      bool operator()(int a, int b);
    };
    void func() {
      const std::set<int, compare> s;
      s.find(0);
    }

because compare::operator() is not const qualified.

N3690 [associative.reqmts]p2 says "The object of type Compare is called the
comparison object of the container", and p3 talks about the requirements on
behavior of a comparison object comp.  However, none of the requirements seem
to impose requirements on objects of type const Compare.


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

end of thread, other threads:[~2015-09-27 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17 19:12 [Bug libstdc++/67617] New: Non-standard const requirements imposed on associate container comparison objects mdempsky at google dot com
2015-09-26 17:24 ` [Bug libstdc++/67617] Non-standard const requirements imposed on associative " daniel.kruegler at googlemail dot com
2015-09-26 18:27 ` daniel.kruegler at googlemail dot com
2015-09-26 20:42 ` daniel.kruegler at googlemail dot com
2015-09-27 10:26 ` [Bug libstdc++/67617] [DR 2542] " 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).