typeck.c (maybe_warn_about_useless_cast): Remove unnecessary conditional.
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 11 Dec 2014 15:45:32 +0000 (15:45 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 11 Dec 2014 15:45:32 +0000 (15:45 +0000)
2014-12-11  Paolo Carlini  <paolo.carlini@oracle.com>

* typeck.c (maybe_warn_about_useless_cast): Remove unnecessary
conditional.

From-SVN: r218629

gcc/cp/ChangeLog
gcc/cp/typeck.c

index c8a66b0de169233760411658ada908a5cdee09d9..0442ef3a8c79a7f03395afed04383e01a46e802c 100644 (file)
@@ -1,3 +1,8 @@
+2014-12-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * typeck.c (maybe_warn_about_useless_cast): Remove unnecessary
+       conditional.
+
 2014-12-10  Kai Tietz  <ktietz@redhat.com>
 
        PR c++/64127
index 2abff6bdb76edd04ace5d11237fde078276100a3..dd60d9891053bc1bf9afb4685970fdcd577c9f7b 100644 (file)
@@ -6363,12 +6363,6 @@ maybe_warn_about_useless_cast (tree type, tree expr, tsubst_flags_t complain)
   if (warn_useless_cast
       && complain & tf_warning)
     {
-      /* In C++14 mode, this interacts badly with force_paren_expr.  And it
-        isn't necessary in any mode, because the code below handles
-        glvalues properly.  For 4.9, just skip it in C++14 mode.  */
-      if (cxx_dialect < cxx14 && REFERENCE_REF_P (expr))
-       expr = TREE_OPERAND (expr, 0);
-
       if ((TREE_CODE (type) == REFERENCE_TYPE
           && (TYPE_REF_IS_RVALUE (type)
               ? xvalue_p (expr) : real_lvalue_p (expr))