From: Jonathan Wakely Date: Fri, 8 Oct 2021 13:45:23 +0000 (+0100) Subject: libstdc++: Detect miscompilation of src/c++11/limits.cc X-Git-Tag: basepoints/gcc-13~4058 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6f6972b5f4711c110fa753c926df49415f230da;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/src/c++11/limits.cc b/libstdc++-v3/src/c++11/limits.cc index 21d4427f10bf..585cb8c92db6 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)