This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r248432 - in /trunk/gcc: cp/ChangeLog cp/decl.c...
- From: redi at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 24 May 2017 22:17:00 -0000
- Subject: r248432 - in /trunk/gcc: cp/ChangeLog cp/decl.c...
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