libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

exception.version.pass.cpp (1593B)


      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 // WARNING: This test was generated by generate_feature_test_macro_components.py
     11 // and should not be edited manually.
     12 
     13 // <exception>
     14 
     15 // Test the feature test macros defined by <exception>
     16 
     17 /*  Constant                         Value
     18     __cpp_lib_uncaught_exceptions    201411L [C++17]
     19 */
     20 
     21 #include <exception>
     22 #include "test_macros.h"
     23 
     24 #if TEST_STD_VER < 14
     25 
     26 # ifdef __cpp_lib_uncaught_exceptions
     27 #   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
     28 # endif
     29 
     30 #elif TEST_STD_VER == 14
     31 
     32 # ifdef __cpp_lib_uncaught_exceptions
     33 #   error "__cpp_lib_uncaught_exceptions should not be defined before c++17"
     34 # endif
     35 
     36 #elif TEST_STD_VER == 17
     37 
     38 # ifndef __cpp_lib_uncaught_exceptions
     39 #   error "__cpp_lib_uncaught_exceptions should be defined in c++17"
     40 # endif
     41 # if __cpp_lib_uncaught_exceptions != 201411L
     42 #   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17"
     43 # endif
     44 
     45 #elif TEST_STD_VER > 17
     46 
     47 # ifndef __cpp_lib_uncaught_exceptions
     48 #   error "__cpp_lib_uncaught_exceptions should be defined in c++2a"
     49 # endif
     50 # if __cpp_lib_uncaught_exceptions != 201411L
     51 #   error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++2a"
     52 # endif
     53 
     54 #endif // TEST_STD_VER > 17
     55 
     56 int main() {}