Index: docs/LanguageExtensions.rst =================================================================== --- docs/LanguageExtensions.rst +++ docs/LanguageExtensions.rst @@ -873,6 +873,22 @@ ``__has_extension(cxx_variable_templates)`` to determine if support for templated variable declarations is enabled. +.. + C++ Technical Specifications + ---------------------------- +.. + The features listed below are part of the various C++ Technical Specifications + or working papers, preliminary drafts, drafts, etc. thereof. These features + may be enabled through the option associated with their respective TS when + compiling C++ code. +.. + C++ Extensions for Concepts + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +.. + Use ``__has_feature(cxx_experimental_concepts)`` or + ``__has_extension(cxx_experimental_concepts)`` to determine if support for + the C++ extensions for concepts is enabled. + C11 --- Index: lib/Lex/PPMacroExpansion.cpp =================================================================== --- lib/Lex/PPMacroExpansion.cpp +++ lib/Lex/PPMacroExpansion.cpp @@ -1163,7 +1163,7 @@ .Case("cxx_variable_templates", LangOpts.CPlusPlus14) // C++ TSes //.Case("cxx_runtime_arrays", LangOpts.CPlusPlusTSArrays) - //.Case("cxx_concepts", LangOpts.CPlusPlusTSConcepts) + //.Case("cxx_experimental_concepts", LangOpts.ConceptsTS) // FIXME: Should this be __has_feature or __has_extension? //.Case("raw_invocation_type", LangOpts.CPlusPlus) // Type traits Index: test/Lexer/has_extension_cxx.cpp =================================================================== --- test/Lexer/has_extension_cxx.cpp +++ test/Lexer/has_extension_cxx.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -std=c++98 -E %s -o - | FileCheck %s // RUN: %clang_cc1 -std=c++11 -E %s -o - | FileCheck %s --check-prefix=CHECK11 +// RUN: %clang_cc1 -std=c++14 -E %s -o - | FileCheck %s --check-prefix=CHECK14 +// RUN: %clang_cc1 -std=c++1z -E %s -o - | FileCheck %s --check-prefix=CHECK1Z // CHECK: c_static_assert #if __has_extension(c_static_assert) @@ -66,3 +68,11 @@ #if __has_extension(cxx_init_captures) int has_init_captures(); #endif + +// CHECK-NOT: has_experimental_concepts +// CHECK11-NOT: has_experimental_concepts +// CHECK14-NOT: has_experimental_concepts +// CHECK1Z-NOT: has_experimental_concepts +#if __has_extension(cxx_experimental_concepts) +int has_experimental_concepts(); +#endif Index: test/Lexer/has_feature_cxx0x.cpp =================================================================== --- test/Lexer/has_feature_cxx0x.cpp +++ test/Lexer/has_feature_cxx0x.cpp @@ -468,3 +468,14 @@ // CHECK-14: has_generic_lambdas // CHECK-11: no_generic_lambdas // CHECK-NO-11: no_generic_lambdas + +#if __has_feature(cxx_experimental_concepts) +int has_experimental_concepts(); +#else +int no_experimental_concepts(); +#endif + +// CHECK-1Z: no_experimental_concepts +// CHECK-14: no_experimental_concepts +// CHECK-11: no_experimental_concepts +// CHECK-NO-11: no_experimental_concepts