diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index e83cfe6d19..3a334ed471 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -58,6 +58,14 @@ char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; # endif #elif defined(_MSC_VER) && defined(_MSVC_LANG) # define CXX_STD _MSVC_LANG +#elif defined(__INTEL_COMPILER) +# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) +# define CXX_STD CXX_STD_17 +# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif #else # define CXX_STD __cplusplus #endif diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp index 3f95b6c3bc..82a8698c37 100644 --- a/Tests/CompileFeatures/default_dialect.cpp +++ b/Tests/CompileFeatures/default_dialect.cpp @@ -27,6 +27,14 @@ struct Outputter; # endif #elif defined(_MSC_VER) && defined(_MSVC_LANG) # define CXX_STD _MSVC_LANG +#elif defined(__INTEL_COMPILER) +# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) +# define CXX_STD CXX_STD_17 +# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif #else # define CXX_STD __cplusplus #endif