This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84918] Better handling of "std::cout >> 42;"
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Jun 2018 23:37:36 +0000
- Subject: [Bug c++/84918] Better handling of "std::cout >> 42;"
- Auto-submitted: auto-generated
- References: <bug-84918-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84918
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2018-06-18
Ever confirmed|0 |1
Severity|normal |enhancement
--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #0)
> https://www.reddit.com/r/cpp/comments/84op5c/usability_improvements_in_gcc_8/dvs5hjj/
> points out:
>
> > What is the current error message for
>
> std::cout >> 42;
>
> > On older compilers this would generate roughly 100 lines of unreadable
> > error messages, so I detect and fix it in the static analyzer I wrote.
>
> Checking on godbolt.org:
>
> #include <iostream>
> void test ()
> {
> std::cout >> 42;
> }
>
> we currently spew dozens of lines of diagnostics.
>
> May be worth special-casing this, and offering a fix-it hint to convert ">>"
> to "<<", if sane (and vice-versa).
Confirmed...
(In reply to Jonathan Wakely from comment #1)
> This seems pretty low priority though
...as an enhancement then. (also ASSIGNED since there's an assignee)