has_extension_cxx.cpp 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // CHECK: c_static_assert
  4. #if __has_extension(c_static_assert)
  5. int c_static_assert();
  6. #endif
  7. // CHECK: c_generic_selections
  8. #if __has_extension(c_generic_selections)
  9. int c_generic_selections();
  10. #endif
  11. // CHECK: has_deleted_functions
  12. #if __has_extension(cxx_deleted_functions)
  13. int has_deleted_functions();
  14. #endif
  15. // CHECK: has_inline_namespaces
  16. #if __has_extension(cxx_inline_namespaces)
  17. int has_inline_namespaces();
  18. #endif
  19. // CHECK: has_override_control
  20. #if __has_extension(cxx_override_control)
  21. int has_override_control();
  22. #endif
  23. // CHECK: has_range_for
  24. #if __has_extension(cxx_range_for)
  25. int has_range_for();
  26. #endif
  27. // CHECK: has_reference_qualified_functions
  28. #if __has_extension(cxx_reference_qualified_functions)
  29. int has_reference_qualified_functions();
  30. #endif
  31. // CHECK: has_rvalue_references
  32. #if __has_extension(cxx_rvalue_references)
  33. int has_rvalue_references();
  34. #endif
  35. // CHECK: has_variadic_templates
  36. #if __has_extension(cxx_variadic_templates)
  37. int has_variadic_templates();
  38. #endif
  39. // CHECK: has_local_type_template_args
  40. #if __has_extension(cxx_local_type_template_args)
  41. int has_local_type_template_args();
  42. #endif
  43. // CHECK: has_binary_literals
  44. #if __has_extension(cxx_binary_literals)
  45. int has_binary_literals();
  46. #endif
  47. // CHECK: has_variable_templates
  48. #if __has_extension(cxx_variable_templates)
  49. int has_variable_templates();
  50. #endif
  51. // CHECK-NOT: has_init_captures
  52. // CHECK11: has_init_captures
  53. #if __has_extension(cxx_init_captures)
  54. int has_init_captures();
  55. #endif