summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-04 08:56:09 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:56 (GMT)
commit04c5b99f38aef9a5c9627c35659891aecd8ab41e (patch)
tree9fd56d7501df6fd2935e090f331ca7af84f3b5fc
parente1e292cd069bf811b0635088539aace0f0eeaf68 (diff)
downloadCMake-04c5b99f38aef9a5c9627c35659891aecd8ab41e.zip
CMake-04c5b99f38aef9a5c9627c35659891aecd8ab41e.tar.gz
CMake-04c5b99f38aef9a5c9627c35659891aecd8ab41e.tar.bz2
Features: Add cxx_user_literals.
-rw-r--r--Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst5
-rw-r--r--Modules/Compiler/GNU-CXX-FeatureTests.cmake1
-rw-r--r--Source/cmMakefile.cxx1
-rw-r--r--Tests/CompileFeatures/cxx_user_literals.cpp7
4 files changed, 14 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index fbc45c2..1ea3b68 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -122,6 +122,11 @@ The features known to this version of CMake are:
.. _N2541: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm
+``cxx_user_literals``
+ User-defined literals, as defined in N2765_.
+
+ .. _N2765: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf
+
``cxx_variadic_templates``
Variadic templates, as defined in N2242_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 5f8d952..12d2adc 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -15,6 +15,7 @@ set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_nonstatic_member_init "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
+set(_cmake_feature_test_cxx_user_literals "${GNU47_CXX11}")
# NOTE: C++11 was ratified in September 2011. GNU 4.7 is the first minor
# release following that (March 2012), and the first minor release to
# support -std=c++11. Prior to that, support for C++11 features is technically
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index fc89d8e..bcd192d 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -64,6 +64,7 @@
F(cxx_static_assert) \
F(cxx_strong_enums) \
F(cxx_trailing_return_types) \
+ F(cxx_user_literals) \
F(cxx_variadic_templates)
class cmMakefile::Internals
diff --git a/Tests/CompileFeatures/cxx_user_literals.cpp b/Tests/CompileFeatures/cxx_user_literals.cpp
new file mode 100644
index 0000000..9e5a588
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_user_literals.cpp
@@ -0,0 +1,7 @@
+
+long double operator "" _meters(long double);
+
+void someFunc()
+{
+ long double i = 1.2_meters;
+}