public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/34730]  New: Legal program doesn't compile with -D_GLIBCXX_DEBUG
@ 2008-01-10 15:40 dominik dot strasser at onespin-solutions dot com
  2008-01-10 15:57 ` [Bug libstdc++/34730] " dominik dot strasser at onespin-solutions dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2008-01-10 15:40 UTC (permalink / raw)
  To: gcc-bugs

The attached C++ source is AFAICS legal C++.
However it doesn't compile with the debug libstdc++, as the debug code assumes
that each given set can be compared with the passed compare operator.


-- 
           Summary: Legal program doesn't compile with -D_GLIBCXX_DEBUG
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominik dot strasser at onespin-solutions dot com
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
@ 2008-01-10 15:57 ` dominik dot strasser at onespin-solutions dot com
  2008-01-10 17:03 ` pcarlini at suse dot de
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2008-01-10 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominik dot strasser at onespin-solutions dot com  2008-01-10 15:28 -------
Created an attachment (id=14909)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14909&action=view)
Source code showing the problem


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
  2008-01-10 15:57 ` [Bug libstdc++/34730] " dominik dot strasser at onespin-solutions dot com
@ 2008-01-10 17:03 ` pcarlini at suse dot de
  2008-01-10 17:06 ` pcarlini at suse dot de
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-10 17:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2008-01-10 15:59 -------
Interesting. I agree the code is legal, on the other hand, we want to check the
required ordering... Would it be ok to you to have the check moved to
_GLIBCXX_DEBUG_PEDANTIC??


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-10 15:59:22
               date|                            |


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
  2008-01-10 15:57 ` [Bug libstdc++/34730] " dominik dot strasser at onespin-solutions dot com
  2008-01-10 17:03 ` pcarlini at suse dot de
@ 2008-01-10 17:06 ` pcarlini at suse dot de
  2008-01-10 21:24 ` pcarlini at suse dot de
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-10 17:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pcarlini at suse dot de  2008-01-10 16:10 -------
Hi Doug. As the main author of our debug-mode, I'd like to know your opinion
about this issue... On one hand, in the actual algorithm we are not comparing
values from the same range, on the other hand, clearly the specifications
require ordering, thus we may want to check it...


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doug dot gregor at gmail dot
                   |                            |com


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (2 preceding siblings ...)
  2008-01-10 17:06 ` pcarlini at suse dot de
@ 2008-01-10 21:24 ` pcarlini at suse dot de
  2008-01-11 18:27 ` bkoz at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-10 21:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2008-01-10 20:04 -------
Thinking more about this issue, probably a more sophisticated solution would be
running the checks only when the value_types are equal. I'll try to prepare
something.


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (3 preceding siblings ...)
  2008-01-10 21:24 ` pcarlini at suse dot de
@ 2008-01-11 18:27 ` bkoz at gcc dot gnu dot org
  2008-01-12 18:23 ` pcarlini at suse dot de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-01-11 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bkoz at gcc dot gnu dot org  2008-01-11 18:05 -------

Paolo, as a quick aside, you might find it useful to look at the concept GCC
library sources for stuff like this.


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (4 preceding siblings ...)
  2008-01-11 18:27 ` bkoz at gcc dot gnu dot org
@ 2008-01-12 18:23 ` pcarlini at suse dot de
  2008-01-12 18:36 ` pcarlini at suse dot de
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-12 18:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pcarlini at suse dot de  2008-01-12 18:12 -------
Thanks for the suggestion, Benjamin. Actually, I don't think we can much better
*without* concepts... Anyway, was thinking that the ordering check is already
impossible to do in other circumstances, like real (single pass) input
iterators, therefore, we have probably to live with that and reconsider the
issue together with concepts, as you are saying.


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (5 preceding siblings ...)
  2008-01-12 18:23 ` pcarlini at suse dot de
@ 2008-01-12 18:36 ` pcarlini at suse dot de
  2008-01-13  2:03 ` paolo at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-12 18:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pcarlini at suse dot de  2008-01-12 18:23 -------
Eh! Interestingly, conceptgcc explicitly enforces the concept that the two
value types must equal! Exactly the case that is covered but my almost-ready
patch.


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (6 preceding siblings ...)
  2008-01-12 18:36 ` pcarlini at suse dot de
@ 2008-01-13  2:03 ` paolo at gcc dot gnu dot org
  2008-01-13  2:13 ` pcarlini at suse dot de
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: paolo at gcc dot gnu dot org @ 2008-01-13  2:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from paolo at gcc dot gnu dot org  2008-01-13 01:35 -------
Subject: Bug 34730

Author: paolo
Date: Sun Jan 13 01:34:58 2008
New Revision: 131500

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131500
Log:
2008-01-12  Paolo Carlini  <pcarlini@suse.de>

        PR libstdc++/34730
        * include/debug/functions.h (__check_sorted_set,
        __check_sorted_set_aux): Add.
        (__check_sorted): Check StrictWeakOrdering.
        * include/debug/macros.h (__glibcxx_check_strict_weak_ordering,
        __glibcxx_check_strict_weak_ordering_pred): Remove.
        (__glibcxx_check_sorted, __glibcxx_check_sorted_pred): Adjust.
        (__glibcxx_check_sorted_set, __glibcxx_check_sorted_set_pred): Add.
        * include/debug/debug.h (__glibcxx_requires_sorted_set,
        __glibcxx_requires_sorted_set_pred): Add.
        * include/bits/stl_algo.h (merge, includes, set_union,
        set_intersection, set_difference, set_symmetric_difference):
        Adjust, use __glibcxx_requires_sorted_set* instead. 
        * testsuite/25_algorithms/set_intersection/34730.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/25_algorithms/set_intersection/34730.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/stl_algo.h
    trunk/libstdc++-v3/include/debug/debug.h
    trunk/libstdc++-v3/include/debug/functions.h
    trunk/libstdc++-v3/include/debug/macros.h


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (7 preceding siblings ...)
  2008-01-13  2:03 ` paolo at gcc dot gnu dot org
@ 2008-01-13  2:13 ` pcarlini at suse dot de
  2008-01-14 18:35 ` bkoz at gcc dot gnu dot org
  2009-05-20 14:58 ` dominik dot strasser at onespin-solutions dot com
  10 siblings, 0 replies; 12+ messages in thread
From: pcarlini at suse dot de @ 2008-01-13  2:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pcarlini at suse dot de  2008-01-13 01:36 -------
Fixed.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (8 preceding siblings ...)
  2008-01-13  2:13 ` pcarlini at suse dot de
@ 2008-01-14 18:35 ` bkoz at gcc dot gnu dot org
  2009-05-20 14:58 ` dominik dot strasser at onespin-solutions dot com
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-01-14 18:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from bkoz at gcc dot gnu dot org  2008-01-14 16:45 -------

Yes, I noticed the much more accurate (and explicit) requirements on
types/algos in concept gcc when hashing through the initial parallel mode work.
I found it very helpful as an implementation (or reimplementation) guide . 


-- 


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


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

* [Bug libstdc++/34730] Legal program doesn't compile with -D_GLIBCXX_DEBUG
  2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
                   ` (9 preceding siblings ...)
  2008-01-14 18:35 ` bkoz at gcc dot gnu dot org
@ 2009-05-20 14:58 ` dominik dot strasser at onespin-solutions dot com
  10 siblings, 0 replies; 12+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2009-05-20 14:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from dominik dot strasser at onespin-solutions dot com  2009-05-20 14:58 -------
Works fine, thanks.


-- 

dominik dot strasser at onespin-solutions dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


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


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

end of thread, other threads:[~2009-05-20 14:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-10 15:40 [Bug libstdc++/34730] New: Legal program doesn't compile with -D_GLIBCXX_DEBUG dominik dot strasser at onespin-solutions dot com
2008-01-10 15:57 ` [Bug libstdc++/34730] " dominik dot strasser at onespin-solutions dot com
2008-01-10 17:03 ` pcarlini at suse dot de
2008-01-10 17:06 ` pcarlini at suse dot de
2008-01-10 21:24 ` pcarlini at suse dot de
2008-01-11 18:27 ` bkoz at gcc dot gnu dot org
2008-01-12 18:23 ` pcarlini at suse dot de
2008-01-12 18:36 ` pcarlini at suse dot de
2008-01-13  2:03 ` paolo at gcc dot gnu dot org
2008-01-13  2:13 ` pcarlini at suse dot de
2008-01-14 18:35 ` bkoz at gcc dot gnu dot org
2009-05-20 14:58 ` dominik dot strasser at onespin-solutions dot com

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