[PATCH] [libcxx] Update the way the -std= flag is chosen by CMake and LibcxxTestFormat

Dan Albert danalbert at google.com
Thu Aug 14 21:09:01 PDT 2014


================
Comment at: CMakeLists.txt:197
@@ -196,3 +196,3 @@
   endif()
-  if (LIBCXX_ENABLE_CXX0X AND LIBCXX_HAS_STDCXX0X_FLAG)
-    list(APPEND LIBCXX_CXX_REQUIRED_FLAGS -std=c++0x)
+  if (LIBCXX_ENABLE_CXX1Y AND LIBCXX_HAS_STDCXX1Y_FLAG)
+    set(LIBCXX_STD_VERSION c++1y)
----------------
I think the case of LIBCXX_ENABLE_CXX1Y && !LIBCXX_HAS_STDCXX1Y_FLAG should raise an error, not fall back to C++11.

================
Comment at: test/lit.cfg:311
@@ +310,3 @@
+    assert std is not None
+    lit_config.note('inferred std as: \'-std={}\''.format(std))
+else:
----------------
It wouldn't be inferred, since it was defined by the user. I also don't think we need to be asserting on the line above. If std isn't defined either from the command line or from lit.site.cfg, we should probably just not pass any -std flag to the compiler and let it do the default. Might add a lit_config.note() stating that this is happening in that case.

http://reviews.llvm.org/D4329






More information about the cfe-commits mailing list