PR c++/80544 strip cv-quals from cast results
commit220a51b06902ece21cc5c67f735b2bbbe8396a81
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 May 2017 22:16:59 +0000 (24 22:16 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 24 May 2017 22:16:59 +0000 (24 22:16 +0000)
tree0b9e9d9dadfb3945f1b82de004c3c56971bdf0ed
parent645b0f8d93618236ed5e0cb2e01710048f98aa7a
PR c++/80544 strip cv-quals from cast results

gcc/cp:

PR c++/80544
* tree.c (reshape_init): Use unqualified type for direct enum init.
* typeck.c (maybe_warn_about_cast_ignoring_quals): New.
(build_static_cast_1, build_reinterpret_cast_1): Strip cv-quals from
non-class destination types.
(build_const_cast_1): Strip cv-quals from destination types.
(build_static_cast, build_reinterpret_cast, build_const_cast)
(cp_build_c_cast): Add calls to maybe_warn_about_cast_ignoring_quals.

gcc/testsuite:

PR c++/80544
* g++.dg/expr/cast11.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248432 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/cast11.C [new file with mode: 0644]