[Bug c++/80544] result of const_cast<T* cv> should by cv-unqualified
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed May 24 22:20:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80544
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Wed May 24 22:16:59 2017
New Revision: 248432
URL: https://gcc.gnu.org/viewcvs?rev=248432&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/expr/cast11.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/cp/typeck.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list