xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/has_extension_cxx.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc // CHECK: c_static_assert
5*f4a2713aSLionel Sambuc #if __has_extension(c_static_assert)
6*f4a2713aSLionel Sambuc int c_static_assert();
7*f4a2713aSLionel Sambuc #endif
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc // CHECK: c_generic_selections
10*f4a2713aSLionel Sambuc #if __has_extension(c_generic_selections)
11*f4a2713aSLionel Sambuc int c_generic_selections();
12*f4a2713aSLionel Sambuc #endif
13*f4a2713aSLionel Sambuc 
14*f4a2713aSLionel Sambuc // CHECK: has_deleted_functions
15*f4a2713aSLionel Sambuc #if __has_extension(cxx_deleted_functions)
16*f4a2713aSLionel Sambuc int has_deleted_functions();
17*f4a2713aSLionel Sambuc #endif
18*f4a2713aSLionel Sambuc 
19*f4a2713aSLionel Sambuc // CHECK: has_inline_namespaces
20*f4a2713aSLionel Sambuc #if __has_extension(cxx_inline_namespaces)
21*f4a2713aSLionel Sambuc int has_inline_namespaces();
22*f4a2713aSLionel Sambuc #endif
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc // CHECK: has_override_control
25*f4a2713aSLionel Sambuc #if __has_extension(cxx_override_control)
26*f4a2713aSLionel Sambuc int has_override_control();
27*f4a2713aSLionel Sambuc #endif
28*f4a2713aSLionel Sambuc 
29*f4a2713aSLionel Sambuc // CHECK: has_range_for
30*f4a2713aSLionel Sambuc #if __has_extension(cxx_range_for)
31*f4a2713aSLionel Sambuc int has_range_for();
32*f4a2713aSLionel Sambuc #endif
33*f4a2713aSLionel Sambuc 
34*f4a2713aSLionel Sambuc // CHECK: has_reference_qualified_functions
35*f4a2713aSLionel Sambuc #if __has_extension(cxx_reference_qualified_functions)
36*f4a2713aSLionel Sambuc int has_reference_qualified_functions();
37*f4a2713aSLionel Sambuc #endif
38*f4a2713aSLionel Sambuc 
39*f4a2713aSLionel Sambuc // CHECK: has_rvalue_references
40*f4a2713aSLionel Sambuc #if __has_extension(cxx_rvalue_references)
41*f4a2713aSLionel Sambuc int has_rvalue_references();
42*f4a2713aSLionel Sambuc #endif
43*f4a2713aSLionel Sambuc 
44*f4a2713aSLionel Sambuc // CHECK: has_local_type_template_args
45*f4a2713aSLionel Sambuc #if __has_extension(cxx_local_type_template_args)
46*f4a2713aSLionel Sambuc int has_local_type_template_args();
47*f4a2713aSLionel Sambuc #endif
48*f4a2713aSLionel Sambuc 
49*f4a2713aSLionel Sambuc // CHECK: has_binary_literals
50*f4a2713aSLionel Sambuc #if __has_extension(cxx_binary_literals)
51*f4a2713aSLionel Sambuc int has_binary_literals();
52*f4a2713aSLionel Sambuc #endif
53*f4a2713aSLionel Sambuc 
54*f4a2713aSLionel Sambuc // CHECK: has_variable_templates
55*f4a2713aSLionel Sambuc #if __has_extension(cxx_variable_templates)
56*f4a2713aSLionel Sambuc int has_variable_templates();
57*f4a2713aSLionel Sambuc #endif
58*f4a2713aSLionel Sambuc 
59*f4a2713aSLionel Sambuc // CHECK-NOT: has_init_captures
60*f4a2713aSLionel Sambuc // CHECK11: has_init_captures
61*f4a2713aSLionel Sambuc #if __has_extension(cxx_init_captures)
62*f4a2713aSLionel Sambuc int has_init_captures();
63*f4a2713aSLionel Sambuc #endif
64