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 r11-4838] libstdc++: Include <typeinfo> even for -fno-rtti [PR 97758]
Date: Mon,  9 Nov 2020 14:28:59 +0000 (GMT)	[thread overview]
Message-ID: <20201109142859.58C313857812@sourceware.org> (raw)

https://gcc.gnu.org/g:99bf3a817b9d31905dd12448e853ad2685635250

commit r11-4838-g99bf3a817b9d31905dd12448e853ad2685635250
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Nov 9 10:09:51 2020 +0000

    libstdc++: Include <typeinfo> even for -fno-rtti [PR 97758]
    
    The std::function code now uses std::type_info* even when RTTI is
    disabled, so it should include <typeinfo> unconditionally. Without this,
    Clang can't compile <functional> with -fno-rtti (it works with GCC
    because std::type_info gets declared automatically by the compiler).
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/97758
            * include/bits/std_function.h [!__cpp_rtti]: Include <typeinfo>.

Diff:
---
 libstdc++-v3/include/bits/std_function.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libstdc++-v3/include/bits/std_function.h b/libstdc++-v3/include/bits/std_function.h
index 054d9cbbf02..1788b882a8a 100644
--- a/libstdc++-v3/include/bits/std_function.h
+++ b/libstdc++-v3/include/bits/std_function.h
@@ -36,9 +36,7 @@
 # include <bits/c++0x_warning.h>
 #else
 
-#if __cpp_rtti
-# include <typeinfo>
-#endif
+#include <typeinfo>
 #include <bits/stl_function.h>
 #include <bits/invoke.h>
 #include <bits/refwrap.h>


                 reply	other threads:[~2020-11-09 14:28 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=20201109142859.58C313857812@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).