c-common.h (enum cxx_dialect): Add cxx1z.
authorJason Merrill <jason@redhat.com>
Thu, 26 Jun 2014 18:15:29 +0000 (14:15 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 26 Jun 2014 18:15:29 +0000 (14:15 -0400)
* c-common.h (enum cxx_dialect): Add cxx1z.
* c.opt (std=c++1z, std=c++17, std=gnu++1z, std=gnu++17): New.
* c-opts.c (c_common_handle_option, set_std_cxx1z): Handle it.

From-SVN: r212042

gcc/c-family/ChangeLog
gcc/c-family/c-common.h
gcc/c-family/c-opts.c
gcc/c-family/c.opt

index 0b23bb3..0112bc5 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-26  Jason Merrill  <jason@redhat.com>
+
+       * c-common.h (enum cxx_dialect): Add cxx1z.
+       * c.opt (std=c++1z, std=c++17, std=gnu++1z, std=gnu++17): New.
+       * c-opts.c (c_common_handle_option, set_std_cxx1z): Handle it.
+
 2014-06-23  Marek Polacek  <polacek@redhat.com>
            Andrew MacLeod  <amacleod@redhat.com>
 
index 8e06487..3e8c8e7 100644 (file)
@@ -640,8 +640,10 @@ enum cxx_dialect {
   /* C++11  */
   cxx0x,
   cxx11 = cxx0x,
-  /* C++1y (C++17?) */
-  cxx1y
+  /* C++1y (C++14?) */
+  cxx1y,
+  /* C++1z (C++17?) */
+  cxx1z
 };
 
 /* The C++ dialect being used. C++98 is the default.  */
index 97215fc..968b703 100644 (file)
@@ -116,6 +116,7 @@ static void handle_OPT_d (const char *);
 static void set_std_cxx98 (int);
 static void set_std_cxx11 (int);
 static void set_std_cxx1y (int);
+static void set_std_cxx1z (int);
 static void set_std_c89 (int, int);
 static void set_std_c99 (int);
 static void set_std_c11 (int);
@@ -702,6 +703,16 @@ c_common_handle_option (size_t scode, const char *arg, int value,
        }
       break;
 
+    case OPT_std_c__1z:
+    case OPT_std_gnu__1z:
+      if (!preprocessing_asm_p)
+       {
+         set_std_cxx1z (code == OPT_std_c__1z /* ISO */);
+         if (code == OPT_std_c__1z)
+           cpp_opts->ext_numeric_literals = 0;
+       }
+      break;
+
     case OPT_std_c90:
     case OPT_std_iso9899_199409:
       if (!preprocessing_asm_p)
@@ -1579,6 +1590,20 @@ set_std_cxx1y (int iso)
   cxx_dialect = cxx1y;
 }
 
+/* Set the C++ 201z draft standard (without GNU extensions if ISO).  */
+static void
+set_std_cxx1z (int iso)
+{
+  cpp_set_lang (parse_in, iso ? CLK_CXX1Y: CLK_GNUCXX1Y);
+  flag_no_gnu_keywords = iso;
+  flag_no_nonansi_builtin = iso;
+  flag_iso = iso;
+  /* C++11 includes the C99 standard library.  */
+  flag_isoc94 = 1;
+  flag_isoc99 = 1;
+  cxx_dialect = cxx1z;
+}
+
 /* Args to -d specify what to dump.  Silently ignore
    unrecognized options; they may be aimed at toplev.c.  */
 static void
index 73abd26..1d02bae 100644 (file)
@@ -1414,6 +1414,13 @@ Conform to the ISO 2014(?) C++ draft standard (experimental and incomplete suppo
 std=c++14
 C++ ObjC++ Alias(std=c++1y) Undocumented
 
+std=c++1z
+C++ ObjC++
+Conform to the ISO 2017(?) C++ draft standard (experimental and incomplete support)
+
+std=c++17
+C++ ObjC++ Alias(std=c++1z) Undocumented
+
 std=c11
 C ObjC
 Conform to the ISO 2011 C standard (experimental and incomplete support)
@@ -1458,11 +1465,18 @@ Deprecated in favor of -std=gnu++11
 
 std=gnu++1y
 C++ ObjC++
-Conform to the ISO 201y(7?) C++ draft standard with GNU extensions (experimental and incomplete support)
+Conform to the ISO 201y(4?) C++ draft standard with GNU extensions (experimental and incomplete support)
 
 std=gnu++14
 C++ ObjC++ Alias(std=gnu++1y) Undocumented
 
+std=gnu++1z
+C++ ObjC++
+Conform to the ISO 201z(7?) C++ draft standard with GNU extensions (experimental and incomplete support)
+
+std=gnu++17
+C++ ObjC++ Alias(std=gnu++1y) Undocumented
+
 std=gnu11
 C ObjC
 Conform to the ISO 2011 C standard with GNU extensions (experimental and incomplete support)