[committed] coroutines: Rename the coroutines cpp builtin.

Message ID 3B9F1AFF-A7F7-4F38-9269-C4ACED316FB6@sandoe.co.uk
State New
Headers show
Series
  • [committed] coroutines: Rename the coroutines cpp builtin.
Related show

Commit Message

Iain Sandoe April 13, 2020, 8 p.m.
Hi,

this is a small piece of housekeeping:    

The current standard draft (n4861) renamed the cpp builtin for
coroutines to ‘__cpp_impl_coroutine’.  No other change.

(NOTE; there are other defines to be added to <coroutine> and <version> but that’s
 a separate issue from this renaming).

tested on x86_64-darwin16
applied to master as obvious

thanks
Iain

gcc/c-family/ChangeLog:

2020-04-13  Iain Sandoe  <iain@sandoe.co.uk>
    
	* c-cppbuiltin.c (c_cpp_builtins): Update coroutines builtin
	define, per n4861.

gcc/testsuite/ChangeLog:

2020-04-13  Iain Sandoe  <iain@sandoe.co.uk>

	* g++.dg/coroutines/coro-pre-proc.C: Update coroutines builtin
	define, per n4861.
	* g++.dg/coroutines/coro.h: Likewise.
    
libstdc++-v3/ChangeLog:

2020-04-13  Iain Sandoe  <iain@sandoe.co.uk>
    
	* include/std/coroutine: Update coroutines builtin define,
	per n4861.

 2020-04-02  Richard Biener  <rguenther@suse.de>
 
 	PR c/94392

Patch

diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 5532ae46ae1..db91a36794a 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1012,7 +1012,7 @@  c_cpp_builtins (cpp_reader *pfile)
             cpp_define (pfile, "__cpp_concepts=201507L");
         }
       if (flag_coroutines)
-	cpp_define (pfile, "__cpp_coroutines=201902L"); /* n4835, C++20 CD */
+	cpp_define (pfile, "__cpp_impl_coroutine=201902L"); /* n4861, DIS */
       if (flag_tm)
 	/* Use a value smaller than the 201505 specified in
 	   the TS, since we don't yet support atomic_cancel.  */

diff --git a/gcc/testsuite/g++.dg/coroutines/coro-pre-proc.C b/gcc/testsuite/g++.dg/coroutines/coro-pre-proc.C
index f22a5e08332..eacdb35d3c7 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro-pre-proc.C
+++ b/gcc/testsuite/g++.dg/coroutines/coro-pre-proc.C
@@ -1,9 +1,9 @@ 
 // Only need to compile this, with the default options from the .exp.
 
-#ifndef __cpp_coroutines
+#ifndef __cpp_impl_coroutine
 #error "coroutines should engaged."
 #endif
 
-#if __cpp_coroutines != 201902L
+#if __cpp_impl_coroutine != 201902L
 #error "coroutine version out of sync."
 #endif
diff --git a/gcc/testsuite/g++.dg/coroutines/coro.h b/gcc/testsuite/g++.dg/coroutines/coro.h
index 31336549f82..a1bd38b8d12 100644
--- a/gcc/testsuite/g++.dg/coroutines/coro.h
+++ b/gcc/testsuite/g++.dg/coroutines/coro.h
@@ -29,7 +29,7 @@  namespace coro = std::experimental;
 // Fragments (with short-cuts) to mimic enough of the library header to
 // make some progress.
 
-#  if __cpp_coroutines
+#  if __cpp_impl_coroutine
 
 namespace std {
 inline namespace __n4835 {

diff --git a/libstdc++-v3/include/std/coroutine b/libstdc++-v3/include/std/coroutine
index 363402330e4..2e45c451450 100644
--- a/libstdc++-v3/include/std/coroutine
+++ b/libstdc++-v3/include/std/coroutine
@@ -54,7 +54,7 @@  namespace std _GLIBCXX_VISIBILITY (default)
 {
   _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
-#if __cpp_coroutines
+#if __cpp_impl_coroutine
   inline namespace __n4835 {
 
   // 17.12.2 coroutine traits