llvm-project/clang/test/Lexer/has_feature_cxx_unstable.cpp
Egor Zhdan 3cdc1c155b [Clang] Add -funstable flag to enable unstable and experimental features
This new flag enables `__has_feature(cxx_unstable)` that would replace libc++ macros for individual unstable/experimental features, e.g. `_LIBCPP_HAS_NO_INCOMPLETE_RANGES` or `_LIBCPP_HAS_NO_INCOMPLETE_FORMAT`.

This would make it easier and more convenient to opt-in into all libc++ unstable features at once.

Differential Revision: https://reviews.llvm.org/D120160
2022-03-01 12:35:20 +00:00

11 lines
353 B
C++

// RUN: %clang_cc1 -funstable -E %s -o - | FileCheck --check-prefix=CHECK-UNSTABLE %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-UNSTABLE %s
#if __has_feature(cxx_unstable)
int has_cxx_unstable();
#else
int has_no_cxx_unstable();
#endif
// CHECK-UNSTABLE: int has_cxx_unstable();
// CHECK-NO-UNSTABLE: int has_no_cxx_unstable();