This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: C++0x name clash: invalid_argument


On Mon, 2007-09-24 at 11:11 -0500, Benjamin Kosnik wrote:
> > When we're in C++0x mode, there are now two different definitions of
> > the name "invalid_argument" in namespace std. The first one is the
> > exception class, which comes from <stdexcept>. The second is an
> > enumerator that comes from <system_error> (for EINVAL). This causes
> > compilation failures in the following program to fail under C++0x
> > mode (and is killing my nightly regression testing of Boost):
> > 
> > #include <stdexcept>
> > #include <system_error>
> > 
> > int main()
> > {
> >   try {
> >   } catch(std::invalid_argument const&) {
> >   }
> > }
> 
> 
> Bummer. You should try to get Beman to add this as a new issue to the
> list of mess-ups in <system_error>. 

Beman says:

  That's Diagnostics issue 21.

  See
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2415.html#Issue21

  The resolution, already implemented in the Boost trunk, is to move the
  enum into a sub-namespace. That avoids both present and future name
  clashes.

So, it looks like we need to implement the resolution to that issue in
libstdc++.

  - Doug


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