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 c++/59165] gcc looks up begin(), end() for for-range loops for ints in namespace std


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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to thakis from comment #0)
> This compiles, but shouldn't:

You add declarations to namespace std which is undefined behaviour, so any
result is valid.

The DR looks wrong to me, the point of treating std as an associated namespace
is that std::begin and std::end will be found for user-defined containers, not
just the standard containers.  I don't know why core decided to change that.


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