summaryrefslogtreecommitdiffstats
path: root/Tests/CompileFeatures
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-04-03 18:26:18 (GMT)
committerBrad King <brad.king@kitware.com>2024-04-05 11:38:14 (GMT)
commit80a5a865142a48bd25e27533683d040adc7d885a (patch)
treedc72920118a744438a57f6c4544921c1c8062560 /Tests/CompileFeatures
parentc9cc3dc6460e32741f42d015343a65beca7482c9 (diff)
downloadCMake-80a5a865142a48bd25e27533683d040adc7d885a.zip
CMake-80a5a865142a48bd25e27533683d040adc7d885a.tar.gz
CMake-80a5a865142a48bd25e27533683d040adc7d885a.tar.bz2
GNU: Fix detection of C++ 11 mode in GCC 4.{4,5,6}
These versions of the compiler have experimental C++11 support and so do not define `__cplusplus` correctly, but do define a feature macro we can use to distinguish this mode.
Diffstat (limited to 'Tests/CompileFeatures')
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index b3ac4e7..f9b770b 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -47,6 +47,8 @@ struct Outputter;
# else
# define CXX_STD __cplusplus
# endif
+#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__)
+# define CXX_STD CXX_STD_11
#else
# define CXX_STD __cplusplus
#endif