D6634: Require C++14
graesslin created this revision. Restricted Application added a project: KWin. Restricted Application added subscribers: KWin, kwin, plasma-devel. REVISION SUMMARY KWin already used C++14 constructs in a conditional way. This doesn't make much sense today, it's better to just require C++14. For KWin only gcc and clang are currently compilers of relevance. Gcc supports C++14 since version 5 and defaults to C++14 since 6.1 [1]. Clang supports C++14 since version 3.4 [2]. An overview of compiler support in various distributions: - Debian stable (stretch): gcc 6.3, clang 3.8 - Debian oldstable (jessie): 4.9, clang 3.5 - Ubuntu 17.04: gcc 6.1, clang 3.8 - Ubuntu 16.04: gcc 5.3, clang 3.8 - openSUSE Tumbleweed: gcc 7.1, clang 4.0 - openSUSE Leap 42.3: gcc ?, clang ? [3] - FreeBSD: clang >= 34 in ports - Slackware 14.2: gcc 5.3 This overview shows that every distro out there has at least one supported compiler which can still compile KWin with this change. [1] https://gcc.gnu.org/projects/cxx-status.html#cxx14 [2] https://clang.llvm.org/cxx_status [3] Sorry I fail to understand openSUSE's package repository. It seems that there is gcc 7 available, but gcc package is 4.8 TEST PLAN Compiles on my neon system REPOSITORY R108 KWin BRANCH cxx-14 REVISION DETAIL https://phabricator.kde.org/D6634 AFFECTED FILES CMakeLists.txt plugins/platforms/x11/standalone/glxbackend.cpp To: graesslin, #plasma Cc: plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
graesslin added a reviewer: lbeltrame. REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame Cc: plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
ivan requested changes to this revision. ivan added a comment. This revision now requires changes to proceed. It is undefined behaviour to extend std:: namespace in this way. You should go for this instead: #if ... template ... make_unique ... #else using std::make_unique; #endif p.s. Another potential problem is that it might happen that a compiler supports a core language from C++XX while the library implementation is behind. But I guess most platforms use libstdc++/gcc so that might not be a problem for kwin. REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame, ivan Cc: ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
ivan accepted this revision. ivan added a comment. This revision is now accepted and ready to land. Ignore my comment above, I'm colour-blind today :D REPOSITORY R108 KWin BRANCH cxx-14 REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame, ivan Cc: ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
lbeltrame added a comment. openSUSE Leap 42.3 uses GCC 4.8 as default, although 5 and 6 are available as well. REPOSITORY R108 KWin BRANCH cxx-14 REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame, ivan Cc: ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
graesslin added a comment. In https://phabricator.kde.org/D6634#124880, @lbeltrame wrote: > openSUSE Leap 42.3 uses GCC 4.8 as default, although 5 and 6 are available as well. @lbeltrame does it mean it would create problems for openSUSE or would it be fine? REPOSITORY R108 KWin BRANCH cxx-14 REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame, ivan Cc: ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
fvogt added a comment. In https://phabricator.kde.org/D6634#125102, @graesslin wrote: > In https://phabricator.kde.org/D6634#124880, @lbeltrame wrote: > > > openSUSE Leap 42.3 uses GCC 4.8 as default, although 5 and 6 are available as well. > > > @lbeltrame does it mean it would create problems for openSUSE or would it be fine? It would be fine. GCC 4.8 is the system compiler, which means it's used by default and used to compile the vast majority of packages (it's the only compiler available in the base SLE, so packages coming from there, like Qt, are always built with it). Leap 42.1 has additionally GCC 5, 42.2 got GCC 6 in plus and 42.3 will get GCC 7 as well. It's just a matter of setting the CC/CXX variables correctly as they're configured to be ABI compatible (`--with-default-libstdcxx-abi=gcc4-compatible` -> std::string with CoW...). REPOSITORY R108 KWin BRANCH cxx-14 REVISION DETAIL https://phabricator.kde.org/D6634 To: graesslin, #plasma, lbeltrame, ivan Cc: fvogt, ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas
D6634: Require C++14
This revision was automatically updated to reflect the committed changes. Closed by commit R108:ea5d611de1bc: Require C++14 (authored by graesslin). REPOSITORY R108 KWin CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D6634?vs=16530&id=16827 REVISION DETAIL https://phabricator.kde.org/D6634 AFFECTED FILES CMakeLists.txt plugins/platforms/x11/standalone/glxbackend.cpp To: graesslin, #plasma, lbeltrame, ivan Cc: fvogt, ivan, plasma-devel, kwin, #kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart, lukas