From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 038B1385840C; Fri, 8 Oct 2021 14:51:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 038B1385840C MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-4255] libstdc++: Detect miscompilation of src/c++11/limits.cc X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 946486ab4f84a5380e1a18e37e4fb9614f5d7992 X-Git-Newrev: e6f6972b5f4711c110fa753c926df49415f230da Message-Id: <20211008145116.038B1385840C@sourceware.org> Date: Fri, 8 Oct 2021 14:51:16 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Oct 2021 14:51:16 -0000 https://gcc.gnu.org/g:e6f6972b5f4711c110fa753c926df49415f230da commit r12-4255-ge6f6972b5f4711c110fa753c926df49415f230da Author: Jonathan Wakely Date: Fri Oct 8 14:45:23 2021 +0100 libstdc++: Detect miscompilation of src/c++11/limits.cc Add a #error directive to ensure that the definitions are not compiled as C++17, which would prevent them being emitted. libstdc++-v3/ChangeLog: PR libstdc++/98725 * src/c++11/limits.cc: Fail if __cpp_inline_variables is defined. Diff: --- libstdc++-v3/src/c++11/limits.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libstdc++-v3/src/c++11/limits.cc b/libstdc++-v3/src/c++11/limits.cc index 21d4427f10b..585cb8c92db 100644 --- a/libstdc++-v3/src/c++11/limits.cc +++ b/libstdc++-v3/src/c++11/limits.cc @@ -29,6 +29,10 @@ // 18.2.1 // +#if __cpp_inline_variables +# error This file must be compiled as C++11 or C++14 +#endif + #include namespace std _GLIBCXX_VISIBILITY(default)