This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69818] warn for C++ functional cast expression on pointer or reference
- 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: Wed, 19 Jul 2017 22:24:56 +0000
- Subject: [Bug c++/69818] warn for C++ functional cast expression on pointer or reference
- Auto-submitted: auto-generated
- References: <bug-69818-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69818
egallager at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-07-19
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #6 from egallager at gcc dot gnu.org ---
(In reply to Chris Studholme from comment #0)
> We have -Wold-style-cast for C-style cast expressions, but there is no
> warning for C++ functional cast expressions even though they are essentially
> equal in their power and potential for problems. Consider this contrived
> example:
>
> short x;
> typedef long& R;
> long& y = R(x);
> typedef long* P;
> long* z = P(&x);
>
Confirming that gcc still prints no warning for this code with
-Wold-style-cast.