public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/33486]  New: parallel v3: functions not in right namespace
@ 2007-09-19  2:34 bangerth at dealii dot org
  2007-09-19 17:05 ` [Bug libstdc++/33486] " bkoz at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2007-09-19  2:34 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug libstdc++/33486] parallel v3: functions not in right namespace
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
@ 2007-09-19 17:05 ` bkoz at gcc dot gnu dot org
  2007-10-10  1:07 ` bangerth at dealii dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2007-09-19 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from bkoz at gcc dot gnu dot org  2007-09-19 17:05 -------

Mine.


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |bkoz at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-19 17:05:45
               date|                            |


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


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

* [Bug libstdc++/33486] parallel v3: functions not in right namespace
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
  2007-09-19 17:05 ` [Bug libstdc++/33486] " bkoz at gcc dot gnu dot org
@ 2007-10-10  1:07 ` bangerth at dealii dot org
  2008-01-21 15:23 ` singler at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2007-10-10  1:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from bangerth at dealii dot org  2007-10-10 01:07 -------
By the way, here is finally also an example that definitely should
compile due to Koenig lookup:
---------------------
#include <algorithm>
#include <vector>
#include <functional>
void f () {
  std::vector<int> boundary_indicators;
  transform (boundary_indicators.begin(), boundary_indicators.end(),
             boundary_indicators.begin(),
             std::bind2nd (std::not_equal_to<int>(), -1));
}
---------------------
Note that this currently yields

d/deal.II> ../../bin/gcc-mainline/bin/c++ -c x.cc -D_GLIBCXX_PARALLEL
x.cc: In function 'void f()':
x.cc:8: error: 'transform' was not declared in this scope


-- 


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


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

* [Bug libstdc++/33486] parallel v3: functions not in right namespace
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
  2007-09-19 17:05 ` [Bug libstdc++/33486] " bkoz at gcc dot gnu dot org
  2007-10-10  1:07 ` bangerth at dealii dot org
@ 2008-01-21 15:23 ` singler at gcc dot gnu dot org
  2008-01-21 22:12 ` bangerth at dealii dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: singler at gcc dot gnu dot org @ 2008-01-21 15:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from singler at gcc dot gnu dot org  2008-01-21 15:14 -------
So is this a bug in the library or in the definition/implementation of
namespace association? The documentation on namespace association even mentions
"argument-dependent lookup".

http://gcc.gnu.org/onlinedocs/gcc/Namespace-Association.html


-- 


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


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

* [Bug libstdc++/33486] parallel v3: functions not in right namespace
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2008-01-21 15:23 ` singler at gcc dot gnu dot org
@ 2008-01-21 22:12 ` bangerth at dealii dot org
  2008-02-25  2:04 ` [Bug c++/33486] namespace association doesn't handle parallel namespaces jason at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2008-01-21 22:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bangerth at dealii dot org  2008-01-21 22:01 -------
I don't know. What namespace are the parallel containers in, and
what namespace are the parallel algorithms in?

W.


-- 


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2008-01-21 22:12 ` bangerth at dealii dot org
@ 2008-02-25  2:04 ` jason at gcc dot gnu dot org
  2008-02-25  6:27 ` jason at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-25  2:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2008-02-25 02:03 -------
This is a compiler bug.


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|bkoz at gcc dot gnu dot org |jason at gcc dot gnu dot org
          Component|libstdc++                   |c++
            Summary|parallel v3: functions not  |namespace association
                   |in right namespace          |doesn't handle parallel
                   |                            |namespaces


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2008-02-25  2:04 ` [Bug c++/33486] namespace association doesn't handle parallel namespaces jason at gcc dot gnu dot org
@ 2008-02-25  6:27 ` jason at gcc dot gnu dot org
  2008-04-01 19:34 ` bkoz at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-02-25  6:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2008-02-25 06:27 -------
Subject: Bug 33486

Author: jason
Date: Mon Feb 25 06:26:24 2008
New Revision: 132611

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132611
Log:
        * gcc/cp/parser.c (cp_parser_declaration): Handle 'inline namespace'.
        (cp_parser_namespace_definition): Likewise.

        PR c++/33486
        * gcc/cp/name-lookup.c (arg_assoc_namespace): Look down into inline
        namespaces, too.

        * libstdc++-v3/include/bits/c++config: Use 'inline namespace'
        instead of strong using.

Added:
    trunk/gcc/testsuite/g++.dg/lookup/strong-using-5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/g++.dg/lookup/strong-using-1.C
    trunk/gcc/testsuite/g++.dg/lookup/strong-using-2.C
    trunk/gcc/testsuite/g++.dg/lookup/strong-using-3.C
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/c++config


-- 


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2008-02-25  6:27 ` jason at gcc dot gnu dot org
@ 2008-04-01 19:34 ` bkoz at gcc dot gnu dot org
  2008-04-07 17:29 ` jason at redhat dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-01 19:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from bkoz at gcc dot gnu dot org  2008-04-01 19:34 -------

Hey Jason, can we get this fixed on 4_3-branch? (Could probably get away with
just 
gcc/cp/name-lookup.c fix, no?)

-benjamin


-- 


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (6 preceding siblings ...)
  2008-04-01 19:34 ` bkoz at gcc dot gnu dot org
@ 2008-04-07 17:29 ` jason at redhat dot com
  2008-04-11 17:32 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jason at redhat dot com @ 2008-04-07 17:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jason at redhat dot com  2008-04-07 17:29 -------
Subject: Re:  namespace association doesn't handle parallel
 namespaces

bkoz at gcc dot gnu dot org wrote:
> Hey Jason, can we get this fixed on 4_3-branch? (Could probably get away with
> just gcc/cp/name-lookup.c fix, no?)

Yes, only the name-lookup.c change would be necessary.  But I'm not the 
one to ask about fixing it on the 4.3 branch; poke the release managers 
for permission.  It should be quite safe.

Jason


-- 


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (7 preceding siblings ...)
  2008-04-07 17:29 ` jason at redhat dot com
@ 2008-04-11 17:32 ` bkoz at gcc dot gnu dot org
  2008-04-18 19:58 ` jason at gcc dot gnu dot org
  2008-04-23 16:41 ` bkoz at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-11 17:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from bkoz at gcc dot gnu dot org  2008-04-11 17:32 -------

OK'd by Richard in private email, so I'm adjusting the Target Milestone to
4.3.1.


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.1


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (8 preceding siblings ...)
  2008-04-11 17:32 ` bkoz at gcc dot gnu dot org
@ 2008-04-18 19:58 ` jason at gcc dot gnu dot org
  2008-04-23 16:41 ` bkoz at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-04-18 19:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jason at gcc dot gnu dot org  2008-04-18 19:57 -------
Subject: Bug 33486

Author: jason
Date: Fri Apr 18 19:56:55 2008
New Revision: 134450

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134450
Log:
        PR c++/33486
        * name-lookup.c (arg_assoc_namespace): Look down into inline
        namespaces, too.

Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/name-lookup.c


-- 


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


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

* [Bug c++/33486] namespace association doesn't handle parallel namespaces
  2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
                   ` (9 preceding siblings ...)
  2008-04-18 19:58 ` jason at gcc dot gnu dot org
@ 2008-04-23 16:41 ` bkoz at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2008-04-23 16:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from bkoz at gcc dot gnu dot org  2008-04-23 16:40 -------

fixed on trunk and gcc-4_3-branch


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-04-23 16:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-19  2:34 [Bug libstdc++/33486] New: parallel v3: functions not in right namespace bangerth at dealii dot org
2007-09-19 17:05 ` [Bug libstdc++/33486] " bkoz at gcc dot gnu dot org
2007-10-10  1:07 ` bangerth at dealii dot org
2008-01-21 15:23 ` singler at gcc dot gnu dot org
2008-01-21 22:12 ` bangerth at dealii dot org
2008-02-25  2:04 ` [Bug c++/33486] namespace association doesn't handle parallel namespaces jason at gcc dot gnu dot org
2008-02-25  6:27 ` jason at gcc dot gnu dot org
2008-04-01 19:34 ` bkoz at gcc dot gnu dot org
2008-04-07 17:29 ` jason at redhat dot com
2008-04-11 17:32 ` bkoz at gcc dot gnu dot org
2008-04-18 19:58 ` jason at gcc dot gnu dot org
2008-04-23 16:41 ` bkoz at gcc dot gnu dot 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).