From: Hans Wennborg Date: Wed, 9 Aug 2017 20:12:53 +0000 (+0000) Subject: Make -std=c++17 an alias of -std=c++1z X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27bed58c783d74e02bb280b2e3f28fcba8ca58c2;p=clang Make -std=c++17 an alias of -std=c++1z As suggested on PR33912. Trying to keep this small to make it easy to merge to the 5.0 branch. We can do a follow-up with more thorough renaming (diagnostic text, options, ids, etc.) later. (For C++14 this was done in r215982, and I think a smaller patch for the 3.5 branch: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20140818/113013.html) Differential Revision: https://reviews.llvm.org/D36532 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310516 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/LangStandards.def b/include/clang/Frontend/LangStandards.def index 669e487023..a019d63922 100644 --- a/include/clang/Frontend/LangStandards.def +++ b/include/clang/Frontend/LangStandards.def @@ -109,15 +109,17 @@ LANGSTANDARD(gnucxx14, "gnu++14", 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", diff --git a/test/Driver/unknown-std.cpp b/test/Driver/unknown-std.cpp index 195a671eda..a7aae51122 100644 --- a/test/Driver/unknown-std.cpp +++ b/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 diff --git a/test/SemaCXX/cxx1z-init-statement.cpp b/test/SemaCXX/cxx1z-init-statement.cpp index 4afe0402d1..d37acd08ce 100644 --- a/test/SemaCXX/cxx1z-init-statement.cpp +++ b/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;