Richard Smith | b438e62 | 2013-09-28 04:37:56 +0000 | [diff] [blame] | 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 |
Peter Collingbourne | d5d410f | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 3 | |
| 4 | // CHECK: c_static_assert |
| 5 | #if __has_extension(c_static_assert) |
| 6 | int c_static_assert(); |
| 7 | #endif |
| 8 | |
| 9 | // CHECK: c_generic_selections |
| 10 | #if __has_extension(c_generic_selections) |
| 11 | int c_generic_selections(); |
| 12 | #endif |
| 13 | |
| 14 | // CHECK: has_deleted_functions |
| 15 | #if __has_extension(cxx_deleted_functions) |
| 16 | int has_deleted_functions(); |
| 17 | #endif |
| 18 | |
| 19 | // CHECK: has_inline_namespaces |
| 20 | #if __has_extension(cxx_inline_namespaces) |
| 21 | int has_inline_namespaces(); |
| 22 | #endif |
| 23 | |
| 24 | // CHECK: has_override_control |
| 25 | #if __has_extension(cxx_override_control) |
| 26 | int has_override_control(); |
| 27 | #endif |
| 28 | |
Richard Smith | a8a5c40 | 2011-09-06 18:03:41 +0000 | [diff] [blame] | 29 | // CHECK: has_range_for |
| 30 | #if __has_extension(cxx_range_for) |
| 31 | int has_range_for(); |
| 32 | #endif |
| 33 | |
Peter Collingbourne | d5d410f | 2011-05-13 20:54:45 +0000 | [diff] [blame] | 34 | // CHECK: has_reference_qualified_functions |
| 35 | #if __has_extension(cxx_reference_qualified_functions) |
| 36 | int has_reference_qualified_functions(); |
| 37 | #endif |
| 38 | |
| 39 | // CHECK: has_rvalue_references |
| 40 | #if __has_extension(cxx_rvalue_references) |
| 41 | int has_rvalue_references(); |
| 42 | #endif |
Douglas Gregor | 9781893 | 2012-04-04 00:48:39 +0000 | [diff] [blame] | 43 | |
Eric Fiselier | 7aa0d4a | 2015-05-12 22:37:23 +0000 | [diff] [blame] | 44 | // CHECK: has_variadic_templates |
| 45 | #if __has_extension(cxx_variadic_templates) |
| 46 | int has_variadic_templates(); |
| 47 | #endif |
| 48 | |
Richard Smith | dca0c7a | 2013-09-27 20:19:41 +0000 | [diff] [blame] | 49 | // CHECK: has_local_type_template_args |
Douglas Gregor | 9781893 | 2012-04-04 00:48:39 +0000 | [diff] [blame] | 50 | #if __has_extension(cxx_local_type_template_args) |
| 51 | int has_local_type_template_args(); |
Douglas Gregor | 9781893 | 2012-04-04 00:48:39 +0000 | [diff] [blame] | 52 | #endif |
| 53 | |
Richard Smith | dca0c7a | 2013-09-27 20:19:41 +0000 | [diff] [blame] | 54 | // CHECK: has_binary_literals |
Richard Smith | 0a71542 | 2013-05-07 19:32:56 +0000 | [diff] [blame] | 55 | #if __has_extension(cxx_binary_literals) |
| 56 | int has_binary_literals(); |
| 57 | #endif |
| 58 | |
Richard Smith | dca0c7a | 2013-09-27 20:19:41 +0000 | [diff] [blame] | 59 | // CHECK: has_variable_templates |
| 60 | #if __has_extension(cxx_variable_templates) |
| 61 | int has_variable_templates(); |
| 62 | #endif |
Richard Smith | b438e62 | 2013-09-28 04:37:56 +0000 | [diff] [blame] | 63 | |
| 64 | // CHECK-NOT: has_init_captures |
| 65 | // CHECK11: has_init_captures |
| 66 | #if __has_extension(cxx_init_captures) |
| 67 | int has_init_captures(); |
| 68 | #endif |