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

           Summary: parallel mode compilation broken - unqualified lookup?
                    (bisected)
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: g...@abeckmann.de
                CC: ja...@gcc.gnu.org


Parallel mode compilation of the following small test fails in current trunk
(r174320):

g++ -W -Wall -D_GLIBCXX_PARALLEL -c parasort.cc
====== 8< =====
#include <vector>
#include <algorithm>

int main()
{
        std::vector<int> v;
        std::sort(v.begin(), v.end());
}
====== >8 =====

This regression was introduced in
    r173965 | jason | 2011-05-20 20:01:22 +0200 (Fri, 20 May 2011) | 33 lines
        PR c++/24163
        PR c++/29131
    gcc/cp/
        * pt.c (tsubst_copy_and_build) [CALL_EXPR]: Avoid repeating
        unqualified lookup.
        * semantics.c (perform_koenig_lookup): Add complain parm.
        ...
    libstdc++-v3/
        * (multiple headers): Explicitly qualify calls to
        functions from dependent bases.
        ...

As this seems to be an intentional change, the parallel mode headers need to be
adjusted as well.

g++ -W -Wall -D_GLIBCXX_PARALLEL -c parasort.cc
In file included from
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/sort.h:44:0,
                 from
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algo.h:45,
                 from
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algorithm:38,
                 from
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/algorithm:66,
                 from parasort.cc:2:
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:
In member function 'void __gnu_parallel::_SplitConsistently<true, _RAIter,
_Compare, _SortingPlacesIterator>::operator()(__gnu_parallel::_ThreadIndex,
__gnu_parallel::_PMWMSSortingData<_RAIter>*, _Compare&, typename
std::iterator_traits<_II1>::difference_type) const [with _RAIter =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
std::less<int>, _SortingPlacesIterator = int*, __gnu_parallel::_ThreadIndex =
short unsigned int, typename std::iterator_traits<_II1>::difference_type = long
int]':
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:347:7:
  instantiated from 'void
__gnu_parallel::parallel_sort_mwms_pu(__gnu_parallel::_PMWMSSortingData<_RAIter>*,
_Compare&) [with bool __stable = false, bool __exact = true, _RAIter =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:462:9:
  instantiated from 'void __gnu_parallel::parallel_sort_mwms(_RAIter, _RAIter,
_Compare, __gnu_parallel::_ThreadIndex) [with bool __stable = false, bool
__exact = true, _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int>
>, _Compare = std::less<int>, __gnu_parallel::_ThreadIndex = short unsigned
int]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/sort.h:103:7:
  instantiated from 'void __gnu_parallel::__parallel_sort(_RAIter, _RAIter,
_Compare, __gnu_parallel::multiway_mergesort_exact_tag) [with bool __stable =
false, _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >,
_Compare = std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/sort.h:183:7:
  instantiated from 'void __gnu_parallel::__parallel_sort(_RAIter, _RAIter,
_Compare, __gnu_parallel::default_parallel_tag) [with bool __stable = false,
_RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algo.h:1772:11:
  instantiated from 'void std::__parallel::sort(_RAIter, _RAIter, _Compare,
_Parallelism) [with _RAIter = __gnu_cxx::__normal_iterator<int*,
std::vector<int> >, _Compare = std::less<int>, _Parallelism =
__gnu_parallel::default_parallel_tag]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algo.h:1786:7:
  instantiated from 'void std::__parallel::sort(_RAIter, _RAIter) [with _RAIter
= __gnu_cxx::__normal_iterator<int*, std::vector<int> >]'
parasort.cc:7:30:   instantiated from here
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:153:4:
error: 'multiseq_partition' was not declared in this scope, and no declarations
were found by argument-dependent lookup at the point of instantiation
[-fpermissive]
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiseq_selection.h:130:50:
note: 'template<class _RanSeqs, class _RankType, class _RankIterator, class
_Compare> void __gnu_parallel::multiseq_partition(_RanSeqs, _RanSeqs,
_RankType, _RankIterator, _Compare)' declared here, later in the translation
unit

<snipped some more of these errors>

/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/losertree.h:
In member function 'unsigned int __gnu_parallel::_LoserTree<false, _Tp,
_Compare>::__init_win
ner(unsigned int) [with _Tp = int, _Compare = std::less<int>]':
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/losertree.h:310:9:
  instantiated from 'void __gnu_parallel::_LoserTree<false, _Tp,
_Compare>::__init() [w
ith _Tp = int, _Compare = std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_merge.h:522:7:
  instantiated from '_RAIter3
__gnu_parallel::multiway_merge_loser_tree(_RAIterIte
rator, _RAIterIterator, _RAIter3, _DifferenceTp, _Compare) [with _LT =
__gnu_parallel::_LoserTree<false, int, std::less<int> >, _RAIterIterator =
__gnu_cxx::__normal_iterator<std::pair<int*, int*>*, std::v
ector<std::pair<int*, int*>, std::allocator<std::pair<int*, int*> > > >,
_RAIter3 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >, _DifferenceTp
= long int, _Compare = std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_merge.h:893:75:
  instantiated from '_RAIter3
__gnu_parallel::__multiway_merge_k_variant_sentinel
_switch<false, __stable, _RAIterIterator, _RAIter3, _DifferenceTp,
_Compare>::operator()(_RAIterIterator, _RAIterIterator, _RAIter3, const
typename std::iterator_traits<typename std::iterator_traits<_RAIte
rIterator>::value_type::first_type>::value_type&, _DifferenceTp, _Compare)
[with bool __stable = false, _RAIterIterator =
__gnu_cxx::__normal_iterator<std::pair<int*, int*>*,
std::vector<std::pair<int*, in
t*>, std::allocator<std::pair<int*, int*> > > >, _RAIter3 =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _DifferenceTp = long
int, _Compare = std::less<int>, typename std::iterator_traits<typenam
e std::iterator_traits<_RAIterIterator>::value_type::first_type>::value_type =
int]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_merge.h:984:4:
  instantiated from '_RAIter3
__gnu_parallel::__sequential_multiway_merge(_RAIterI
terator, _RAIterIterator, _RAIter3, const typename
std::iterator_traits<typename
std::iterator_traits<_RAIterIterator>::value_type::first_type>::value_type&,
_DifferenceTp, _Compare) [with bool __stable =
false, bool __sentinels = false, _RAIterIterator =
__gnu_cxx::__normal_iterator<std::pair<int*, int*>*,
std::vector<std::pair<int*, int*>, std::allocator<std::pair<int*, int*> > > >,
_RAIter3 = __gnu_cxx::
__normal_iterator<int*, std::vector<int> >, _DifferenceTp = long int, _Compare
= std::less<int>, typename std::iterator_traits<typename
std::iterator_traits<_RAIterIterator>::value_type::first_type>::value
_type = int]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_merge.h:1432:44:
  instantiated from '_RAIterOut
__gnu_parallel::multiway_merge(_RAIterPairIterat
or, _RAIterPairIterator, _RAIterOut, _DifferenceTp, _Compare,
__gnu_parallel::sequential_tag) [with _RAIterPairIterator =
__gnu_cxx::__normal_iterator<std::pair<int*, int*>*,
std::vector<std::pair<int*, in
t*>, std::allocator<std::pair<int*, int*> > > >, _RAIterOut =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _DifferenceTp = long
int, _Compare = std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:297:9:
  [ skipping 2 instantiation contexts ]
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/multiway_mergesort.h:462:9:
  instantiated from 'void __gnu_parallel::parallel_sort_mwms(_RAIter, _RAIter,
 _Compare, __gnu_parallel::_ThreadIndex) [with bool __stable = false, bool
__exact = true, _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int>
>, _Compare = std::less<int>, __gnu_parallel::_Threa
dIndex = short unsigned int]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/sort.h:103:7:
  instantiated from 'void __gnu_parallel::__parallel_sort(_RAIter, _RAIter,
_Compare, __gnu_
parallel::multiway_mergesort_exact_tag) [with bool __stable = false, _RAIter =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/sort.h:183:7:
  instantiated from 'void __gnu_parallel::__parallel_sort(_RAIter, _RAIter,
_Compare, __gnu_
parallel::default_parallel_tag) [with bool __stable = false, _RAIter =
__gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare =
std::less<int>]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algo.h:1772:11:
  instantiated from 'void std::__parallel::sort(_RAIter, _RAIter, _Compare,
_Parallelism)
[with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >, _Compare
= std::less<int>, _Parallelism = __gnu_parallel::default_parallel_tag]'
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/algo.h:1786:7:
  instantiated from 'void std::__parallel::sort(_RAIter, _RAIter) [with _RAIter
= __gnu_cxx
::__normal_iterator<int*, std::vector<int> >]'
parasort.cc:7:30:   instantiated from here
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/losertree.h:290:6:
error: '_M_comp' was not declared in this scope, and no declarations were found
by argu
ment-dependent lookup at the point of instantiation [-fpermissive]
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/losertree.h:290:6:
note: declarations in dependent base '__gnu_parallel::_LoserTreeBase<int,
std::less<int
> >' are not found by unqualified lookup
/tmp/bisect47/bisect/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/parallel/losertree.h:290:6:
note: use 'this->_M_comp' instead

Reply via email to