public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/48472] New: some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x
@ 2011-04-05 21:17 blaise at suitabletech dot com
2011-04-05 21:22 ` [Bug libstdc++/48472] " pinskia at gcc dot gnu.org
2011-04-05 22:08 ` [Bug c++/48472] " redi at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: blaise at suitabletech dot com @ 2011-04-05 21:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48472
Summary: some flavors of std::bind are included in the global
namespace when you include <functional> with
-std=c++0x
Product: gcc
Version: 4.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: blaise@suitabletech.com
The following program compiles correctly. I believe it should not because bind
should not be in the global namespace. (If you take A out of std this program
fails as one would expect.)
-------------------------------------
// Compile with: g++ test.cpp -std=c++0x -c
#include <functional>
namespace std
{
class A
{};
}
void f(std::A a)
{
bind(&f, a);
}
-------------------------------------
Output of g++ -v:
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug libstdc++/48472] some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x
2011-04-05 21:17 [Bug libstdc++/48472] New: some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x blaise at suitabletech dot com
@ 2011-04-05 21:22 ` pinskia at gcc dot gnu.org
2011-04-05 22:08 ` [Bug c++/48472] " redi at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-04-05 21:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48472
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-04-05 21:22:03 UTC ---
No this is not in the global namespace but rather namelookup looks at std::bind
when one of the arguments are in std namespace.
namespace std
{
class A
{};
}
namespace std
{
template<typename A>
void g(void (*a)(A), A);
}
void h(std::A a)
{
g(&h, a);
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/48472] some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x
2011-04-05 21:17 [Bug libstdc++/48472] New: some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x blaise at suitabletech dot com
2011-04-05 21:22 ` [Bug libstdc++/48472] " pinskia at gcc dot gnu.org
@ 2011-04-05 22:08 ` redi at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2011-04-05 22:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48472
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-04-05 22:08:21 UTC ---
right, this is Argument Dependent Lookup and is a feature of C++
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-05 22:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-05 21:17 [Bug libstdc++/48472] New: some flavors of std::bind are included in the global namespace when you include <functional> with -std=c++0x blaise at suitabletech dot com
2011-04-05 21:22 ` [Bug libstdc++/48472] " pinskia at gcc dot gnu.org
2011-04-05 22:08 ` [Bug c++/48472] " redi 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).