public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58191] New: Can't use boost transform_iterator with _GLIBCXX_DEBUG
@ 2013-08-19  5:45 woodroof at gmail dot com
  2013-08-19  9:28 ` [Bug c++/58191] " paolo.carlini at oracle dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: woodroof at gmail dot com @ 2013-08-19  5:45 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 9113 bytes --]

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

            Bug ID: 58191
           Summary: Can't use boost transform_iterator with _GLIBCXX_DEBUG
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: woodroof at gmail dot com

Given:
A simple code:

int calc_value(int original_value)
{
    return original_value % 3;
}

int main()
{
    std::vector<int> numbers;
    std::upper_bound(
        boost::make_transform_iterator(numbers.begin(), calc_value),
        boost::make_transform_iterator(numbers.end(), calc_value),
        1);
}

Gcc version: g++ (Ubuntu 4.8.1-2ubuntu1~13.04) 4.8.1
Additional command line params: -D_GLIBCXX_DEBUG

Result: Compilation error
In file included from /usr/include/c++/4.8/debug/debug.h:127:0,
                 from /usr/include/c++/4.8/bits/stl_iterator_base_funcs.h:65,
                 from /usr/include/c++/4.8/bits/stl_algobase.h:66,
                 from /usr/include/c++/4.8/vector:60,
                 from 1.cpp:1:
/usr/include/c++/4.8/debug/functions.h: In instantiation of ‘bool
__gnu_debug::__check_partitioned_upper(_ForwardIterator, _ForwardIterator,
const _Tp&) [with _ForwardIterator = boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>; _Tp = int]’:
/usr/include/c++/4.8/bits/stl_algo.h:2506:358:   required from ‘_FIter
std::upper_bound(_FIter, _FIter, const _Tp&) [with _FIter =
boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>; _Tp = int]’
1.cpp:16:4:   required from here
/usr/include/c++/4.8/debug/functions.h:428:42: error: no matching function for
call to ‘__check_partitioned_upper_aux(boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>&, boost::transform_iterator<int
(*)(int), __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>&, const int&,
std::iterator_traits<boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default> >::iterator_category)’
         std::__iterator_category(__first));
                                          ^
/usr/include/c++/4.8/debug/functions.h:428:42: note: candidates are:
/usr/include/c++/4.8/debug/functions.h:393:5: note: template<class
_ForwardIterator, class _Tp> bool
__gnu_debug::__check_partitioned_upper_aux(_ForwardIterator, _ForwardIterator,
const _Tp&, std::forward_iterator_tag)
     __check_partitioned_upper_aux(_ForwardIterator __first,
     ^
/usr/include/c++/4.8/debug/functions.h:393:5: note:   template argument
deduction/substitution failed:
/usr/include/c++/4.8/debug/functions.h:428:42: note:   cannot convert
‘std::__iterator_category<boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default> >((*(const
boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>*)(& __first)))’ (type
‘std::iterator_traits<boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default> >::iterator_category {aka
boost::detail::iterator_category_with_traversal<std::input_iterator_tag,
boost::random_access_traversal_tag>}’) to type ‘std::forward_iterator_tag’
         std::__iterator_category(__first));
                                          ^
/usr/include/c++/4.8/debug/functions.h:412:5: note: template<class _Iterator,
class _Sequence, class _Tp> bool
__gnu_debug::__check_partitioned_upper_aux(const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const _Tp&,
std::random_access_iterator_tag)
     __check_partitioned_upper_aux(
     ^
/usr/include/c++/4.8/debug/functions.h:412:5: note:   template argument
deduction/substitution failed:
/usr/include/c++/4.8/debug/functions.h:428:42: note:  
‘boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>’ is not derived from ‘const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>’
         std::__iterator_category(__first));
                                          ^
/usr/include/c++/4.8/debug/functions.h:498:5: note: template<class _Iterator,
class _Sequence, class _Tp, class _Pred> bool
__gnu_debug::__check_partitioned_upper_aux(const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>&, const _Tp&, _Pred,
std::random_access_iterator_tag)
     __check_partitioned_upper_aux(
     ^
/usr/include/c++/4.8/debug/functions.h:498:5: note:   template argument
deduction/substitution failed:
/usr/include/c++/4.8/debug/functions.h:428:42: note:  
‘boost::transform_iterator<int (*)(int),
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*,
std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int>
>, boost::use_default, boost::use_default>’ is not derived from ‘const
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>’
         std::__iterator_category(__first));
                                          ^
/usr/include/c++/4.8/debug/functions.h:477:5: note: template<class
_ForwardIterator, class _Tp, class _Pred> bool
__gnu_debug::__check_partitioned_upper_aux(_ForwardIterator, _ForwardIterator,
const _Tp&, _Pred, std::forward_iterator_tag)
     __check_partitioned_upper_aux(_ForwardIterator __first,
     ^
/usr/include/c++/4.8/debug/functions.h:477:5: note:   template argument
deduction/substitution failed:
/usr/include/c++/4.8/debug/functions.h:428:42: note:   candidate expects 5
arguments, 4 provided
         std::__iterator_category(__first));
                                          ^

gcc 4.7.3 works fine
>From gcc-bugs-return-428010-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Aug 19 05:48:00 2013
Return-Path: <gcc-bugs-return-428010-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 20938 invoked by alias); 19 Aug 2013 05:48:00 -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 20915 invoked by uid 48); 19 Aug 2013 05:47:58 -0000
From: "woodroof at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58191] Can't use boost transform_iterator with _GLIBCXX_DEBUG
Date: Mon, 19 Aug 2013 05:48: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: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: major
X-Bugzilla-Who: woodroof at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
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: attachments.created
Message-ID: <bug-58191-4-lZwVBOxQSb@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58191-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58191-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: 2013-08/txt/msg00934.txt.bz2
Content-length: 239

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX191

--- Comment #1 from Danil Ilinykh <woodroof at gmail dot com> ---
Created attachment 30671
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0671&actioníit
Preprocessed file archive


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

end of thread, other threads:[~2013-10-16 20:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19  5:45 [Bug c++/58191] New: Can't use boost transform_iterator with _GLIBCXX_DEBUG woodroof at gmail dot com
2013-08-19  9:28 ` [Bug c++/58191] " paolo.carlini at oracle dot com
2013-08-19  9:31 ` paolo.carlini at oracle dot com
2013-08-19  9:34 ` daniel.kruegler at googlemail dot com
2013-08-19  9:47 ` daniel.kruegler at googlemail dot com
2013-08-19 10:05 ` [Bug libstdc++/58191] " redi at gcc dot gnu.org
2013-08-19 11:08 ` paolo.carlini at oracle dot com
2013-08-30 20:16 ` fdumont at gcc dot gnu.org
2013-08-30 21:06 ` paolo.carlini at oracle dot com
2013-10-16 20:09 ` fdumont 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).