[coroutines] Bump __cpp_coroutines version
authorEric Fiselier <eric@efcs.ca>
Thu, 25 May 2017 14:58:46 +0000 (14:58 +0000)
committerEric Fiselier <eric@efcs.ca>
Thu, 25 May 2017 14:58:46 +0000 (14:58 +0000)
Summary: This patch is needed so that Libc++ can actually tess if Clang supports coroutines, instead of just paying lip service with a partial implementation. Otherwise the libc++ test suite will fail against older versions of Clang

Reviewers: GorNishanov, rsmith

Reviewed By: GorNishanov

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D33536

llvm-svn: 303867

clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Lexer/cxx-features.cpp

index 9257dca..08befb3 100644 (file)
@@ -535,7 +535,7 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
   if (LangOpts.ConceptsTS)
     Builder.defineMacro("__cpp_experimental_concepts", "1");
   if (LangOpts.CoroutinesTS)
-    Builder.defineMacro("__cpp_coroutines", "1");
+    Builder.defineMacro("__cpp_coroutines", "201703L");
 }
 
 static void InitializePredefinedMacros(const TargetInfo &TI,
index d69ef08..24f38e5 100644 (file)
 #error "wrong value for __cpp_experimental_concepts"
 #endif
 
-#if (COROUTINES && !__cpp_coroutines) || (!COROUTINES && __cpp_coroutines)
+#if defined(COROUTINES) ? check(coroutines, 201703L, 201703L, 201703L, 201703L) : check(coroutines, 0, 0, 0, 0)
 #error "wrong value for __cpp_coroutines"
 #endif