]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Detect miscompilation of src/c++11/limits.cc
authorJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 13:45:23 +0000 (14:45 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 8 Oct 2021 14:51:08 +0000 (15:51 +0100)
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.

libstdc++-v3/src/c++11/limits.cc

index 21d4427f10bfd21581be65367d7312062abde951..585cb8c92db6cabdcd27965b313c32c87f2bf343 100644 (file)
 // 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)