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

* [Bug libstdc++/67617] Non-standard const requirements imposed on associative container comparison objects
  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 ` daniel.kruegler at googlemail dot com
  2015-09-26 18:27 ` daniel.kruegler at googlemail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2015-09-26 17:24 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #1)
> If that code is conforming then it's a defect in the standard.

I agree. I believe the wording for associative containers is not as clear as it
should be. For unordered containers 23.2.5 p11 speaks of "possibly const value"
for hasher and binary predicate, but in 23.2.4 p8 this additional "possibly
const" requirement is missing. I'm submitting an LWG issue for this and provide
the issue number once available.
>From gcc-bugs-return-498098-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Sep 26 17:53:01 2015
Return-Path: <gcc-bugs-return-498098-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 124321 invoked by alias); 26 Sep 2015 17:53:01 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 124263 invoked by uid 55); 26 Sep 2015 17:52:57 -0000
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67567] resolve.c: gfc_error called with iface->module == NULL
Date: Sat, 26 Sep 2015 17:53:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: minor
X-Bugzilla-Who: pault at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67567-4-f6ASc9owYA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67567-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67567-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg02076.txt.bz2
Content-length: 562

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg567

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sat Sep 26 17:52:24 2015
New Revision: 228169

URL: https://gcc.gnu.org/viewcvs?rev"8169&root=gcc&view=rev
Log:
2013-09-26  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/67567
        * resolve.c (resolve_fl_procedure): For module procedures, take
        the parent module name and the submodule name from the name of
        the namespace.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c


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

* [Bug libstdc++/67617] Non-standard const requirements imposed on associative container comparison objects
  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
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2015-09-26 18:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Both Clang/libc++ and MSVC/Dinkumware reject it for the same reason.

I notice that the Dinkumware version associated with Visual Studio 2015 accepts
the code.
>From gcc-bugs-return-498101-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Sep 26 18:27:03 2015
Return-Path: <gcc-bugs-return-498101-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 43041 invoked by alias); 26 Sep 2015 18:27:03 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 42989 invoked by uid 48); 26 Sep 2015 18:26:59 -0000
From: "rbock at eudoxos dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67319] Short-hand concepts for variadic member functions broken
Date: Sat, 26 Sep 2015 18:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rbock at eudoxos dot de
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67319-4-LIMg8yUB2i@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67319-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67319-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg02079.txt.bz2
Content-length: 383

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg319

--- Comment #1 from Roland B <rbock at eudoxos dot de> ---
Using the terse notation works fine, btw:


// -----------------------------
template <typename T>
concept bool Any()
{
  return true;
}

struct my_struct
{
  auto sample(Any... args) -> void;
};

int main()
{
  my_struct{}.sample();
}
// -------------------------------


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

* [Bug libstdc++/67617] Non-standard const requirements imposed on associative container comparison objects
  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
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2015-09-26 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Daniel Krügler from comment #4)
> (In reply to Jonathan Wakely from comment #2)
> > Both Clang/libc++ and MSVC/Dinkumware reject it for the same reason.
> 
> I notice that the Dinkumware version associated with Visual Studio 2015
> accepts the code.

... assuming a proper definition of the operator() overload is provided,
of-course.
>From gcc-bugs-return-498108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Sep 26 21:05:13 2015
Return-Path: <gcc-bugs-return-498108-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 64205 invoked by alias); 26 Sep 2015 21:05:12 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 64190 invoked by uid 48); 26 Sep 2015 21:05:09 -0000
From: "ryan.burn at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67727] New: [concepts] parameterized constraint not being checked for unused variables
Date: Sat, 26 Sep 2015 21:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ryan.burn at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67727-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg02086.txt.bz2
Content-length: 1787

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg727

            Bug ID: 67727
           Summary: [concepts] parameterized constraint not being checked
                    for unused variables
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ryan.burn at gmail dot com
  Target Milestone: ---

The following code prints 1 1, but according to

http://stackoverflow.com/questions/32801326/in-requires-parameter-lists-can-you-introduce-types-that-result-in-substitution

should print 1 0

/////////////////////////////////////////////////////////////////////////
#include <iterator>
#include <iostream>

template <class Iter>
concept bool Iterator     requires(Iter i, typename std::iterator_traits<Iter>::value_type val,
             typename std::iterator_traits<Iter>::reference ref) {
  ++i;
};

int main() {
  std::cout << Iterator<int*> << "\n"; // prints 1
  std::cout << Iterator<int> << "\n"; // prints 1
  return 0;
}
/////////////////////////////////////////////////////////////////////////


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

* [Bug libstdc++/67617] [DR 2542] Non-standard const requirements imposed on associative container comparison objects
  2015-09-17 19:12 [Bug libstdc++/67617] New: Non-standard const requirements imposed on associate container comparison objects mdempsky at google dot com
                   ` (2 preceding siblings ...)
  2015-09-26 20:42 ` daniel.kruegler at googlemail dot com
@ 2015-09-27 10:26 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-09-27 10:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |SUSPENDED
   Last reconfirmed|                            |2015-09-27
            Summary|Non-standard const          |[DR 2542] Non-standard
                   |requirements imposed on     |const requirements imposed
                   |associative container       |on associative container
                   |comparison objects          |comparison objects
     Ever confirmed|0                           |1


^ 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).