public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: "John Maddock" <john_maddock@compuserve.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/8503: strange behaviour of function types. Date: Sat, 09 Nov 2002 03:56:00 -0000 [thread overview] Message-ID: <20021109115601.16929.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/8503; it has been noted by GNATS. From: "John Maddock" <john_maddock@compuserve.com> To: <paolo@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>, <john_maddock@compuserve.com>, <nobody@gcc.gnu.org>, <gcc-gnats@gcc.gnu.org> Cc: Subject: Re: c++/8503: strange behaviour of function types. Date: Sat, 9 Nov 2002 11:20:17 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C287E1.FB7F23C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > Unfortunately, the example code got lost. > Could you possibly send it to me privately? I will complete > the PR with it. > Thanks, Paolo. See attached. ------=_NextPart_000_0026_01C287E1.FB7F23C0 Content-Type: application/octet-stream; name="Gcc_bug.cpp" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Gcc_bug.cpp" #include <iostream> template <class T> struct is_const { static void check() { std::cout << "non-const\n"; } }; template <class T> struct is_const<T const> { static void check() { std::cout << "const\n"; } }; template <class T> void overload_reference(T&) {std::cout << "non-const\n"; } template <class T> void overload_reference(const volatile T&) {std::cout << "const\n"; } template <class T> void overload_pointer(T*) {std::cout << "non-const\n"; } template <class T> void overload_pointer(const volatile T*) {std::cout << "const\n"; } int sample_proc(int) { return 0; } int main() { typedef int (foo_type)(int); is_const<foo_type>::check(); foo_type& f = sample_proc; overload_reference(f); foo_type* pf = &f; overload_pointer(pf); } ------=_NextPart_000_0026_01C287E1.FB7F23C0--
next reply other threads:[~2002-11-09 11:56 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-11-09 3:56 John Maddock [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-11-09 7:09 paolo 2002-11-09 7:01 paolo 2002-11-09 7:00 paolo 2002-11-08 5:07 paolo 2002-11-08 4:46 john_maddock
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=20021109115601.16929.qmail@sources.redhat.com \ --to=john_maddock@compuserve.com \ --cc=gcc-prs@gcc.gnu.org \ --cc=paolo@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: linkBe 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).