[PATCH] D36532: Add -std=c++17

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 9 13:14:06 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL310516: Make -std=c++17 an alias of -std=c++1z (authored by hans).

Changed prior to commit:
  https://reviews.llvm.org/D36532?vs=110430&id=110462#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D36532

Files:
  cfe/trunk/include/clang/Frontend/LangStandards.def
  cfe/trunk/test/Driver/unknown-std.cpp
  cfe/trunk/test/SemaCXX/cxx1z-init-statement.cpp


Index: cfe/trunk/include/clang/Frontend/LangStandards.def
===================================================================
--- cfe/trunk/include/clang/Frontend/LangStandards.def
+++ cfe/trunk/include/clang/Frontend/LangStandards.def
@@ -109,15 +109,17 @@
              GNUMode)
 LANGSTANDARD_ALIAS_DEPR(gnucxx14, "gnu++1y")
 
-LANGSTANDARD(cxx1z, "c++1z",
-             CXX, "Working draft for ISO C++ 2017",
+LANGSTANDARD(cxx17, "c++17",
+             CXX, "ISO C++ 2017 with amendments",
              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus1z |
              Digraphs | HexFloat)
+LANGSTANDARD_ALIAS_DEPR(cxx17, "c++1z")
 
-LANGSTANDARD(gnucxx1z, "gnu++1z",
-             CXX, "Working draft for ISO C++ 2017 with GNU extensions",
+LANGSTANDARD(gnucxx17, "gnu++17",
+             CXX, "ISO C++ 2017 with amendments and GNU extensions",
              LineComment | CPlusPlus | CPlusPlus11 | CPlusPlus14 | CPlusPlus1z |
              Digraphs | HexFloat | GNUMode)
+LANGSTANDARD_ALIAS_DEPR(gnucxx17, "gnu++1z")
 
 LANGSTANDARD(cxx2a, "c++2a",
              CXX, "Working draft for ISO C++ 2020",
Index: cfe/trunk/test/Driver/unknown-std.cpp
===================================================================
--- cfe/trunk/test/Driver/unknown-std.cpp
+++ cfe/trunk/test/Driver/unknown-std.cpp
@@ -13,8 +13,8 @@
 // CHECK-NEXT: note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard
 // CHECK-NEXT: note: use 'c++14' for 'ISO C++ 2014 with amendments' standard
 // CHECK-NEXT: note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard
-// CHECK-NEXT: note: use 'c++1z' for 'Working draft for ISO C++ 2017' standard
-// CHECK-NEXT: note: use 'gnu++1z' for 'Working draft for ISO C++ 2017 with GNU extensions' standard
+// CHECK-NEXT: note: use 'c++17' for 'ISO C++ 2017 with amendments' standard
+// CHECK-NEXT: note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard
 // CHECK-NEXT: note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard
 // CHECK-NEXT: note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard
 // CUDA-NEXT: note: use 'cuda' for 'NVIDIA CUDA(tm)' standard
Index: cfe/trunk/test/SemaCXX/cxx1z-init-statement.cpp
===================================================================
--- cfe/trunk/test/SemaCXX/cxx1z-init-statement.cpp
+++ cfe/trunk/test/SemaCXX/cxx1z-init-statement.cpp
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -std=c++1z -verify %s
+// RUN: %clang_cc1 -std=c++17 -verify %s
 
 void testIf() {
   int x = 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36532.110462.patch
Type: text/x-patch
Size: 2579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170809/ea138b5e/attachment.bin>


More information about the cfe-commits mailing list