XLC C++ should not declare full C++11 and C++14 support
Operating system: AIX 7.1.
Compiler version:
bash-4.3$ ./xlC -qversion
IBM XL C/C++ for AIX, V16.1.0 (5725-C72, 5765-J12)
Version: 16.01.0000.0004
Hey guys,
We have recently started an attempt to upgrade the AIX compiler used at our company to version 16.1.0 and it has revealed that CMake is too eager to declare that this compiler has full support for the C++11 and C++14 features. To give a tiny example, this C++ file:
struct Dummy
{
void something() noexcept {}
};
int main(int, char**)
{
return 0;
}
Does not compile when I request cxx_std_11
via target_compile_features
(CMake passes -qlanglvl=extended0x
):
"test.cpp", line 3.22: 1540-0063 (S) The text "noexcept" is unexpected.
It's even worse when I request cxx_std_14
though because then CMake passes -qlanglvl=extended1y
which is, apparently, not a valid compiler flag:
1540-5200 (W) The option "langlvl=extended1y" is not supported.
"test.cpp", line 3.22: 1540-0063 (S) The text "noexcept" is unexpected.
As far as I'm aware, no version of XLC has full support for C++11 and C++14, so CMAKE_CXX11_STANDARD__HAS_FULL_SUPPORT
and CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT
cannot be set to ON
. Probably it should follow the same individual feature detection model as SunPro-CXX-FeatureTests.cmake
?