[PATCH] Guard the noexcept with __cplusplus version.

Logan Chien tzuhsiang.chien at gmail.com
Mon May 5 10:39:12 PDT 2014


Hi mclow.lists,

To allow the compilation with gcc, we can't use the
__has_feature(noexcept) to detect the existence of noexcept
keyword.  We should use __cplusplus >= 201103L instead.

http://reviews.llvm.org/D3612

Files:
  test/test_vector1.cpp

Index: test/test_vector1.cpp
===================================================================
--- test/test_vector1.cpp
+++ test/test_vector1.cpp
@@ -49,7 +49,7 @@
 void throw_construct ( void *p ) { if ( gConstructorCounter   == gConstructorThrowTarget ) throw 1; ++gConstructorCounter; }
 void throw_destruct  ( void *p ) { if ( ++gDestructorCounter  == gDestructorThrowTarget  ) throw 2; }
 
-#if __has_feature(cxx_noexcept)
+#if __cplusplus >= 201103L
 #   define CAN_THROW noexcept(false)
 #else
 #   define CAN_THROW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3612.9081.patch
Type: text/x-patch
Size: 526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140505/fc680b3f/attachment.bin>


More information about the cfe-commits mailing list