public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Detect miscompilation of src/c++11/limits.cc
@ 2021-10-08 14:51 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-10-08 14:51 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

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.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 870 bytes --]

commit e6f6972b5f4711c110fa753c926df49415f230da
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 8 14:45:23 2021

    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 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 <limits>
 
 namespace std _GLIBCXX_VISIBILITY(default)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-08 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 14:51 [committed] libstdc++: Detect miscompilation of src/c++11/limits.cc Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).