X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fcp%2Ftypeck.c;h=a79f6e2dd46add26747ca47b18e042524cd313ae;hb=5b339181bd79211632e0da0c37f37c8ade7906a8;hp=7a1a725b69a9dbdb837d5eedd99757629bf9ac5e;hpb=9330edc6d7c81b8d542c453b47d6356bece57f95;p=pf3gnuchains%2Fgcc-fork.git
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 7a1a725b69a..a79f6e2dd46 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -8,7 +8,7 @@ This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
@@ -17,9 +17,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+. */
/* This file is part of the C++ front end.
@@ -1080,6 +1079,14 @@ structural_comptypes (tree t1, tree t2, int strict)
return same_type_p (PACK_EXPANSION_PATTERN (t1),
PACK_EXPANSION_PATTERN (t2));
+ case DECLTYPE_TYPE:
+ if (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t1)
+ != DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t2)
+ || !cp_tree_equal (DECLTYPE_TYPE_EXPR (t1),
+ DECLTYPE_TYPE_EXPR (t2)))
+ return false;
+ break;
+
default:
return false;
}
@@ -3207,7 +3214,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
if ((code0 == INTEGER_TYPE && code1 == INTEGER_TYPE)
- || (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE))
+ || (code0 == VECTOR_TYPE && code1 == VECTOR_TYPE
+ && !VECTOR_FLOAT_TYPE_P (type0)
+ && !VECTOR_FLOAT_TYPE_P (type1)))
shorten = -1;
break;
@@ -6639,7 +6648,7 @@ check_return_expr (tree retval, bool *no_warning)
|| DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR)
&& !TYPE_NOTHROW_P (TREE_TYPE (current_function_decl))
&& ! flag_check_new
- && null_ptr_cst_p (retval))
+ && retval && null_ptr_cst_p (retval))
warning (0, "% must not return NULL unless it is "
"declared % (or -fcheck-new is in effect)");
@@ -6694,6 +6703,7 @@ check_return_expr (tree retval, bool *no_warning)
&& TREE_CODE (retval) == VAR_DECL
&& DECL_CONTEXT (retval) == current_function_decl
&& ! TREE_STATIC (retval)
+ && ! DECL_ANON_UNION_VAR_P (retval)
&& (DECL_ALIGN (retval)
>= DECL_ALIGN (DECL_RESULT (current_function_decl)))
/* The cv-unqualified type of the returned value must be the