This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/33486] New: parallel v3: functions not in right namespace


The following three programs compile just fine in normal mode, but
don't in parallel mode:
--------------------
#include <algorithm>
#include <set>
void f () {
  std::set<int> boundary_indicators;
  find (boundary_indicators.begin(), boundary_indicators.end(), 1);
}
--------------------
#include <algorithm>
#include <vector>
void f () {
  std::vector<int> boundary_indicators;
  sort (boundary_indicators.begin(), boundary_indicators.end());
}
-------------------
#include <algorithm>
#include <vector>
int negate (int i) { return -i; }
void f () {
  std::vector<int> boundary_indicators;
  transform (boundary_indicators.begin(), boundary_indicators.end(),
             boundary_indicators.begin(),
             &negate);
}
--------------------
The reason is that, unlike in normal mode, the functions find, sort, and 
transform are not in the namespaces of one of the arguments, and are therefore
not found using Koenig lookup.

I consider the question whether the standard mandates that these programs
need to compile at all of secondary interest, since parallel mode should be
a drop-in replacement that can be compiled with the same user code base. As
one data point, above programs have been extracted from a code base that
has compiled just fine with about half a dozen compilers for several years
now, so this is probably pretty common.


-- 
           Summary: parallel v3: functions not in right namespace
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]