summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-04-04 11:54:08 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-04-08 09:05:56 (GMT)
commite7d6e1f44f0f3bcf7ded76ec8d649b7a0552778c (patch)
treede0fcbb4d64adc851fde71e15f58afe798b5fe04
parent32c2acd65c3d48433a50a6c2f9fc00c2a1a699f4 (diff)
downloadCMake-e7d6e1f44f0f3bcf7ded76ec8d649b7a0552778c.zip
CMake-e7d6e1f44f0f3bcf7ded76ec8d649b7a0552778c.tar.gz
CMake-e7d6e1f44f0f3bcf7ded76ec8d649b7a0552778c.tar.bz2
Features: Add cxx_alignas.
cxx_alignof will be a separate feature known to CMake, because both can be implemented with separate backward compatibility versions.
-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_alignas.cpp4
4 files changed, 11 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
index 6c4bc15..043863f 100644
--- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
+++ b/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst
@@ -17,6 +17,11 @@ The features known to this version of CMake are:
.. _N2258: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
+``cxx_alignas``
+ Alignment control ``alignas``, as defined in N2341_.
+
+ .. _N2341: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf
+
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index ee7f2e4..86d5557 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -6,6 +6,7 @@ set(_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408")
set(_cmake_feature_test_cxx_reference_qualified_functions
"((__GNUC__ * 100 + __GNUC_MINOR__) > 408 || __GNUC_PATCHLEVEL__ >= 1) && __cplusplus >= 201103L")
set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L")
+set(_cmake_feature_test_cxx_alignas "${GNU48_CXX11}")
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
# TODO: Should be supported by GNU 4.7
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 1803afe..b1dd721 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -43,6 +43,7 @@
#define FOR_EACH_CXX_FEATURE(F) \
F(cxx_alias_templates) \
+ F(cxx_alignas) \
F(cxx_auto_type) \
F(cxx_constexpr) \
F(cxx_decltype) \
diff --git a/Tests/CompileFeatures/cxx_alignas.cpp b/Tests/CompileFeatures/cxx_alignas.cpp
new file mode 100644
index 0000000..35b7c82
--- /dev/null
+++ b/Tests/CompileFeatures/cxx_alignas.cpp
@@ -0,0 +1,4 @@
+
+struct S1 {
+ alignas(8) int n;
+};