public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "b.r.longbons at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/52114] New: SFINAE out the rvalue iostream operators to give better error messages Date: Fri, 03 Feb 2012 18:53:00 -0000 [thread overview] Message-ID: <bug-52114-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52114 Bug #: 52114 Summary: SFINAE out the rvalue iostream operators to give better error messages Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: b.r.longbons@gmail.com Created attachment 26566 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26566 Use SFINAE in delayed return type to make sure there's an lvalue version Currently, if there is no stream insertion/extraction operator defined for a class, it tries to use the template that takes an rvalue istream or ostream and anything on the right. Actual Result: error: cannot bind ‘std::ostream {aka std::basic_ostream<char>}’ lvalue to ‘std::basic_ostream<char>&&’ /usr/include/c++/4.6/ostream:581:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char, _Traits = std::char_traits<char>, _Tp = Foo]’ Expected Result: error: no match for ‘operator<<’ in ‘std::cout << Foo()’ note: candidates are: Note that this patch is not safe to apply to 4.6 because of bug 51878
next reply other threads:[~2012-02-03 18:53 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-03 18:53 b.r.longbons at gmail dot com [this message] 2012-02-04 19:02 ` [Bug libstdc++/52114] " redi at gcc dot gnu.org 2012-02-04 20:33 ` paolo.carlini at oracle dot com 2012-02-04 20:40 ` paolo.carlini at oracle dot com 2012-02-04 21:44 ` daniel.kruegler at googlemail dot com 2012-02-04 22:37 ` b.r.longbons at gmail dot com 2012-02-04 22:49 ` paolo.carlini at oracle dot com 2012-02-04 22:53 ` redi at gcc dot gnu.org 2012-02-04 22:55 ` redi at gcc dot gnu.org 2012-02-04 22:58 ` paolo.carlini at oracle dot com 2012-02-04 23:00 ` paolo.carlini at oracle dot com 2012-02-05 11:00 ` daniel.kruegler at googlemail dot com 2012-02-05 11:11 ` paolo.carlini at oracle dot com
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=bug-52114-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@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).