libcxx with Visual C++ : don't redefine _NOEXCEPT when already defined

Yaron Keren yaron.keren at gmail.com
Thu Dec 26 04:52:41 PST 2013


With Visual C++ __config redefines _NOEXCEPT resulting in a warning:

ibcxx\include\__config(434) : warning C4005: '_NOEXCEPT' : macro
redefinition
        C:\Program Files (x86)\Microsoft Visual Studio
12.0\VC\INCLUDE\yvals.h(25) : see previous definition of '_NOEXCEPT'

I checked and at least Visual C++ 2012, 2013 define _NOEXCEPT in yvals.h.

This patch #ifndef _NOEXCEPT to avoid the warning.

Alternative solution could be to remove it completely, as Visual C++ seems
to supply it. Maybe it was for an older version of Visual C++.

Yaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131226/f47c63a1/attachment.html>
-------------- next part --------------
Index: __config
===================================================================
--- __config	(revision 198042)
+++ __config	(working copy)
@@ -431,7 +431,9 @@
 #define _ALIGNAS(x) __declspec(align(x))
 #define _LIBCPP_HAS_NO_VARIADICS
 
+#ifndef _NOEXCEPT
 #define _NOEXCEPT throw()
+#endif
 #define _NOEXCEPT_(x)
 
 #define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {


More information about the cfe-commits mailing list