summaryrefslogtreecommitdiff
path: root/contrib/gcc/cp/decl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/cp/decl2.c')
-rw-r--r--contrib/gcc/cp/decl2.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c
index 43349631b4de6..730bbfb55f000 100644
--- a/contrib/gcc/cp/decl2.c
+++ b/contrib/gcc/cp/decl2.c
@@ -1519,7 +1519,13 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
/* friend or constructor went bad. */
return value;
if (TREE_TYPE (value) == error_mark_node)
- return error_mark_node;
+ return error_mark_node;
+
+ if (TREE_CODE (value) == TYPE_DECL && init)
+ {
+ error ("typedef `%D' is initialized (use __typeof__ instead)", value);
+ init = NULL_TREE;
+ }
/* Pass friendly classes back. */
if (TREE_CODE (value) == VOID_TYPE)
@@ -3795,10 +3801,8 @@ build_expr_from_tree (t)
case ALIGNOF_EXPR:
{
tree r = build_expr_from_tree (TREE_OPERAND (t, 0));
- if (!TYPE_P (r))
- return TREE_CODE (t) == SIZEOF_EXPR ? expr_sizeof (r) : c_alignof_expr (r);
- else
- return TREE_CODE (t) == SIZEOF_EXPR ? c_sizeof (r) : c_alignof (r);
+ return (TREE_CODE (t) == SIZEOF_EXPR
+ ? finish_sizeof (r) : finish_alignof (r));
}
case MODOP_EXPR: