public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r12-4255] libstdc++: Detect miscompilation of src/c++11/limits.cc
Date: Fri,  8 Oct 2021 14:51:16 +0000 (GMT)	[thread overview]
Message-ID: <20211008145116.038B1385840C@sourceware.org> (raw)

https://gcc.gnu.org/g:e6f6972b5f4711c110fa753c926df49415f230da

commit r12-4255-ge6f6972b5f4711c110fa753c926df49415f230da
Author: Jonathan Wakely <jwakely@redhat.com>
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 <limits>
 
 namespace std _GLIBCXX_VISIBILITY(default)


                 reply	other threads:[~2021-10-08 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008145116.038B1385840C@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).