Avoid taking the address of something just because it's in parens.
authorJason Merrill <jason@redhat.com>
Fri, 22 Jun 2018 21:57:01 +0000 (17:57 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 22 Jun 2018 21:57:01 +0000 (17:57 -0400)
commite4511ca2e9ecdb51d41b64452398f8e2df575668
tree2dbc5f08013ebca3a6f5a11a3a562b29f0d8ab9c
parent73607ff9ec812d546fcd89e136dac482d9684371
Avoid taking the address of something just because it's in parens.

* constexpr.c (same_type_ignoring_tlq_and_bounds_p): New.
(cxx_fold_indirect_ref): Use it.
(cxx_eval_constant_expression) [VIEW_CONVERT_EXPR]: Use it.
* cp-tree.h (REF_PARENTHESIZED_P): Allow VIEW_CONVERT_EXPR.
* semantics.c (force_paren_expr): Use VIEW_CONVERT_EXPR instead of
static_cast to reference type.
(maybe_undo_parenthesized_ref): Handle VIEW_CONVERT_EXPR.

From-SVN: r261971
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/semantics.c