Index: include/clang/Basic/LangOptions.def =================================================================== --- include/clang/Basic/LangOptions.def +++ include/clang/Basic/LangOptions.def @@ -167,6 +167,7 @@ LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators") LANGOPT(SizedDeallocation , 1, 0, "enable sized deallocation functions") +LANGOPT(ConceptsTS , 1, 0, "enable C++ Extensions for Concepts") BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision") BENIGN_LANGOPT(DumpRecordLayouts , 1, 0, "dumping the layout of IRgen'd records") BENIGN_LANGOPT(DumpRecordLayoutsSimple , 1, 0, "dumping the layout of IRgen'd records in a simple form") Index: include/clang/Driver/CC1Options.td =================================================================== --- include/clang/Driver/CC1Options.td +++ include/clang/Driver/CC1Options.td @@ -365,6 +365,8 @@ Flag<["-"], "fmodules-local-submodule-visibility">, HelpText<"Enforce name visibility rules across submodules of the same " "top-level module.">; +def fconcepts_ts : Flag<["-"], "fconcepts-ts">, + HelpText<"Enable C++ Extensions for Concepts.">; let Group = Action_Group in { Index: lib/Frontend/CompilerInvocation.cpp =================================================================== --- lib/Frontend/CompilerInvocation.cpp +++ lib/Frontend/CompilerInvocation.cpp @@ -1537,6 +1537,7 @@ Opts.NoMathBuiltin = Args.hasArg(OPT_fno_math_builtin); Opts.AssumeSaneOperatorNew = !Args.hasArg(OPT_fno_assume_sane_operator_new); Opts.SizedDeallocation = Args.hasArg(OPT_fsized_deallocation); + Opts.ConceptsTS = Args.hasArg(OPT_fconcepts_ts); Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); Opts.AccessControl = !Args.hasArg(OPT_fno_access_control); Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors); Index: lib/Frontend/InitPreprocessor.cpp =================================================================== --- lib/Frontend/InitPreprocessor.cpp +++ lib/Frontend/InitPreprocessor.cpp @@ -453,6 +453,8 @@ } if (LangOpts.SizedDeallocation) Builder.defineMacro("__cpp_sized_deallocation", "201309"); + if (LangOpts.ConceptsTS) + Builder.defineMacro("__cpp_experimental_concepts", "1"); } static void InitializePredefinedMacros(const TargetInfo &TI, Index: test/Lexer/cxx-features.cpp =================================================================== --- test/Lexer/cxx-features.cpp +++ test/Lexer/cxx-features.cpp @@ -1,6 +1,7 @@ // RUN: %clang_cc1 -std=c++98 -verify %s // RUN: %clang_cc1 -std=c++11 -verify %s // RUN: %clang_cc1 -std=c++1y -fsized-deallocation -verify %s +// RUN: %clang_cc1 -std=c++1y -fsized-deallocation -fconcepts-ts -DCONCEPTS_TS=1 -verify %s // expected-no-diagnostics @@ -123,3 +124,7 @@ #if check(alias_templates, 0, 200704, 200704) #error "wrong value for __cpp_alias_templates" #endif + +#if check(experimental_concepts, 0, 0, CONCEPTS_TS) +#error "wrong value for __cpp_experimental_concepts" +#endif Index: www/cxx_status.html =================================================================== --- www/cxx_status.html +++ www/cxx_status.html @@ -631,7 +631,7 @@ [DRAFT TS] Concepts - N3929 + N4377 No