This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36870] __has_nothrow_constructor violates the ODR
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jul 2008 21:47:45 -0000
- Subject: [Bug c++/36870] __has_nothrow_constructor violates the ODR
- References: <bug-36870-1186@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from sebor at roguewave dot com 2008-07-18 21:47 -------
(In reply to comment #4)
The ODR is important from an ABI standpoint -- imagine a function template
that uses SFINAE and std::has_nothrow_default_constructor<T>::type. Simply
rearranging code or even compiling multiple sources in the same step could
change which overload will be selected, potentially causing an ABI breakage.
The compiler must give the same answer for the same type regardless of the
context. That might mean not considering the body of the function if it
can't be done 100% consistently (e.g., for out-of-line functions).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36870