diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-10-08 14:45:23 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-10-08 15:51:08 +0100 |
commit | e6f6972b5f4711c110fa753c926df49415f230da (patch) | |
tree | 0bd66b194c985b7b1ffe0175cb29f7457484370b | |
parent | 946486ab4f84a5380e1a18e37e4fb9614f5d7992 (diff) | |
download | gcc-e6f6972b5f4711c110fa753c926df49415f230da.zip gcc-e6f6972b5f4711c110fa753c926df49415f230da.tar.gz gcc-e6f6972b5f4711c110fa753c926df49415f230da.tar.bz2 |
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.
-rw-r--r-- | libstdc++-v3/src/c++11/limits.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libstdc++-v3/src/c++11/limits.cc b/libstdc++-v3/src/c++11/limits.cc index 21d4427..585cb8c 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 <limits> namespace std _GLIBCXX_VISIBILITY(default) |