2012-03-16 Paolo Carlini <paolo.carlini@oracle.com>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Mar 2012 15:51:25 +0000 (15:51 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 19 Mar 2012 15:51:25 +0000 (15:51 +0000)
commit62206d34fbed0af4ecde1cbea17997577afb1377
treeeb01dfeebfb11d2b3e7c2be23d3c53d59ce5da9e
parentc165a03322031cc0a957872b394ae9a8d04b0794
2012-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/14710
* doc/invoke.texi: Document -Wuseless-cast.

/c-family
2012-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/14710
* c.opt ([Wuseless-cast]): Add.

/cp
2012-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/14710
* cp-tree.h (maybe_warn_about_useless_cast): Declare.
* typeck.c (maybe_warn_about_useless_cast): Define.
(build_reinterpret_cast, build_const_cast,
build_static_cast, cp_build_c_cast): Use it.
* rtti.c (build_dynamic_cast): Likewise.
* pt.c (tsubst_copy_and_build, case CAST_EXPR): Increment/decrement
c_inhibit_evaluation_warnings before/after the build_* calls.

/testsuite
2012-03-16  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/14710
* g++.dg/warn/Wuseless-cast.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185524 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/pt.c
gcc/cp/rtti.c
gcc/cp/tree.c
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/testsuite/g++.dg/warn/Wuseless-cast.C [new file with mode: 0644]