[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / clang / test / Lexer / has_extension_cxx.cpp
blob7366029d3727a164b82c84537783e9721072a492
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
6 // CHECK: c_static_assert
7 #if __has_extension(c_static_assert)
8 int c_static_assert();
9 #endif
11 // CHECK: c_generic_selections
12 #if __has_extension(c_generic_selections)
13 int c_generic_selections();
14 #endif
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
21 // CHECK: has_defaulted_functions
22 #if __has_extension(cxx_defaulted_functions)
23 int has_defaulted_functions();
24 #endif
26 // CHECK: has_deleted_functions
27 #if __has_extension(cxx_deleted_functions)
28 int has_deleted_functions();
29 #endif
31 // CHECK: has_inline_namespaces
32 #if __has_extension(cxx_inline_namespaces)
33 int has_inline_namespaces();
34 #endif
36 // CHECK: has_lambdas
37 #if __has_extension(cxx_lambdas)
38 int has_lambdas();
39 #endif
41 // CHECK: has_override_control
42 #if __has_extension(cxx_override_control)
43 int has_override_control();
44 #endif
46 // CHECK: has_range_for
47 #if __has_extension(cxx_range_for)
48 int has_range_for();
49 #endif
51 // CHECK: has_reference_qualified_functions
52 #if __has_extension(cxx_reference_qualified_functions)
53 int has_reference_qualified_functions();
54 #endif
56 // CHECK: has_rvalue_references
57 #if __has_extension(cxx_rvalue_references)
58 int has_rvalue_references();
59 #endif
61 // CHECK: has_variadic_templates
62 #if __has_extension(cxx_variadic_templates)
63 int has_variadic_templates();
64 #endif
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
71 // CHECK: has_binary_literals
72 #if __has_extension(cxx_binary_literals)
73 int has_binary_literals();
74 #endif
76 // CHECK: has_variable_templates
77 #if __has_extension(cxx_variable_templates)
78 int has_variable_templates();
79 #endif
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
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
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