r290082 - Add __cpp_structured_bindings feature test macro for structured bindings, per

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 18 20:21:36 PST 2016


Author: rsmith
Date: Sun Dec 18 22:21:36 2016
New Revision: 290082

URL: http://llvm.org/viewvc/llvm-project?rev=290082&view=rev
Log:
Add __cpp_structured_bindings feature test macro for structured bindings, per
latest (provisional) draft of SD-6.

Modified:
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp
    cfe/trunk/test/Lexer/cxx-features.cpp

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=290082&r1=290081&r2=290082&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Sun Dec 18 22:21:36 2016
@@ -519,6 +519,7 @@ static void InitializeCPlusPlusFeatureTe
     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");
   }

Modified: cfe/trunk/test/Lexer/cxx-features.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/cxx-features.cpp?rev=290082&r1=290081&r2=290082&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/cxx-features.cpp (original)
+++ cfe/trunk/test/Lexer/cxx-features.cpp Sun Dec 18 22:21:36 2016
@@ -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"




More information about the cfe-commits mailing list