From: Richard Smith Date: Mon, 19 Dec 2016 04:21:36 +0000 (+0000) Subject: Add __cpp_structured_bindings feature test macro for structured bindings, per X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=38ec5559c9787083f6945c3f4162346f3416ccc7;p=clang Add __cpp_structured_bindings feature test macro for structured bindings, per latest (provisional) draft of SD-6. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290082 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp index d8102cc80a..17603ada11 100644 --- a/lib/Frontend/InitPreprocessor.cpp +++ b/lib/Frontend/InitPreprocessor.cpp @@ -519,6 +519,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts, Builder.defineMacro("__cpp_nested_namespace_definitions", "201411"); Builder.defineMacro("__cpp_variadic_using", "201611"); Builder.defineMacro("__cpp_aggregate_bases", "201603"); + Builder.defineMacro("__cpp_structured_bindings", "201606"); Builder.defineMacro("__cpp_nontype_template_args", "201411"); Builder.defineMacro("__cpp_fold_expressions", "201603"); } diff --git a/test/Lexer/cxx-features.cpp b/test/Lexer/cxx-features.cpp index 8f1e286a29..5fc1722e94 100644 --- a/test/Lexer/cxx-features.cpp +++ b/test/Lexer/cxx-features.cpp @@ -78,11 +78,15 @@ #error "wrong value for __cpp_nested_namespace_definitions" #endif +// inheriting_constructors checked below + #if check(aggregate_bases, 0, 0, 0, 201603) #error "wrong value for __cpp_aggregate_bases" #endif -// FIXME: structured_bindings / decomposition_decl name not yet settled +#if check(structured_bindings, 0, 0, 0, 201606) +#error "wrong value for __cpp_structured_bindings" +#endif #if check(nontype_template_args, 0, 0, 0, 201411) #error "wrong value for __cpp_nontype_template_args"