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++/49045] [C++0x] unexpected "different exception specifier" error with noexcept


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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-18 18:24:31 UTC ---
Or, rather:

template<typename _Tp>
  void
  swap(_Tp&, _Tp&);

template<class T> void __swap_dummy(T&& a,T&& b)
  noexcept(noexcept(swap(a,b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__swap_dummy(*__a, *__b)));

template<typename _Tp, __SIZE_TYPE__ _Nm>
  void
  swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  noexcept(noexcept(__swap_dummy(*__a, *__b)))
{ swap(*__a,*__b); }

-----

__swap_dummy doesn't actually need a body, but it does need a
noexcept-specifier.


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