1 // RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s 2 // RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11 3 // RUN: %clang_cc1 -std=c++20 -E %s -o - | FileCheck %s --check-prefix=CHECK20 4 // RUN: %clang_cc1 -std=c++23 -E %s -o - | FileCheck %s --check-prefix=CHECK23 5 6 // CHECK: c_static_assert 7 #if __has_extension(c_static_assert) 8 int c_static_assert(); 9 #endif 10 11 // CHECK: c_generic_selections 12 #if __has_extension(c_generic_selections) 13 int c_generic_selections(); 14 #endif 15 16 // CHECK: has_default_function_template_args 17 #if __has_extension(cxx_default_function_template_args) 18 int has_default_function_template_args(); 19 #endif 20 21 // CHECK: has_defaulted_functions 22 #if __has_extension(cxx_defaulted_functions) 23 int has_defaulted_functions(); 24 #endif 25 26 // CHECK: has_deleted_functions 27 #if __has_extension(cxx_deleted_functions) 28 int has_deleted_functions(); 29 #endif 30 31 // CHECK: has_inline_namespaces 32 #if __has_extension(cxx_inline_namespaces) 33 int has_inline_namespaces(); 34 #endif 35 36 // CHECK: has_lambdas 37 #if __has_extension(cxx_lambdas) 38 int has_lambdas(); 39 #endif 40 41 // CHECK: has_override_control 42 #if __has_extension(cxx_override_control) 43 int has_override_control(); 44 #endif 45 46 // CHECK: has_range_for 47 #if __has_extension(cxx_range_for) 48 int has_range_for(); 49 #endif 50 51 // CHECK: has_reference_qualified_functions 52 #if __has_extension(cxx_reference_qualified_functions) 53 int has_reference_qualified_functions(); 54 #endif 55 56 // CHECK: has_rvalue_references 57 #if __has_extension(cxx_rvalue_references) 58 int has_rvalue_references(); 59 #endif 60 61 // CHECK: has_variadic_templates 62 #if __has_extension(cxx_variadic_templates) 63 int has_variadic_templates(); 64 #endif 65 66 // CHECK: has_local_type_template_args 67 #if __has_extension(cxx_local_type_template_args) 68 int has_local_type_template_args(); 69 #endif 70 71 // CHECK: has_binary_literals 72 #if __has_extension(cxx_binary_literals) 73 int has_binary_literals(); 74 #endif 75 76 // CHECK: has_variable_templates 77 #if __has_extension(cxx_variable_templates) 78 int has_variable_templates(); 79 #endif 80 81 // CHECK-NOT: has_init_captures 82 // CHECK11: has_init_captures 83 #if __has_extension(cxx_init_captures) 84 int has_init_captures(); 85 #endif 86 87 88 // CHECK11-NOT: has_generalized_nttp 89 // CHECK20: has_generalized_nttp 90 #if __has_extension(cxx_generalized_nttp) 91 int has_generalized_nttp(); 92 #endif 93 94 95 // CHECK20-NOT: has_explicit_this_parameter 96 // CHECK23: has_explicit_this_parameter 97 #if __has_extension(cxx_explicit_this_parameter) 98 int has_explicit_this_parameter(); 99 #endif 100