Teach test suite about C++2a dialect flag.

This patch teaches the test suite configuration about the -std=c++2a
flag. And, since it's the newest dialect, change the test suite to
choose it, if possible, by default.

llvm-svn: 317611
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 537309342d7d9bb7e8dbd2f89a2e1489cacbf251
diff --git a/docs/TestingLibcxx.rst b/docs/TestingLibcxx.rst
index 8f0d985..43c0684 100644
--- a/docs/TestingLibcxx.rst
+++ b/docs/TestingLibcxx.rst
@@ -112,7 +112,7 @@
 
 .. option:: std=<standard version>
 
-  **Values**: c++98, c++03, c++11, c++14, c++17
+  **Values**: c++98, c++03, c++11, c++14, c++17, c++2a
 
   Change the standard version used when building the tests.
 
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index 0d907d7..4ed67c2 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -517,7 +517,8 @@
         std = self.get_lit_conf('std')
         if not std:
             # Choose the newest possible language dialect if none is given.
-            possible_stds = ['c++17', 'c++1z', 'c++14', 'c++11', 'c++03']
+            possible_stds = ['c++2a', 'c++17', 'c++1z', 'c++14', 'c++11',
+                             'c++03']
             if self.cxx.type == 'gcc':
                 maj_v, _, _ = self.cxx.version
                 maj_v = int(maj_v)
@@ -888,7 +889,7 @@
         # Turn on warnings by default for Clang based compilers when C++ >= 11
         default_enable_warnings = self.cxx.type in ['clang', 'apple-clang'] \
             and len(self.config.available_features.intersection(
-                ['c++11', 'c++14', 'c++17'])) != 0
+                ['c++11', 'c++14', 'c++17', 'c++2a'])) != 0
         enable_warnings = self.get_lit_bool('enable_warnings',
                                             default_enable_warnings)
         self.cxx.useWarnings(enable_warnings)