Deleted Added
full compact
1383,1386c1383
<
< /* Already complained about this, so don't do so again. */
< else if (current_class_type == NULL_TREE
< || IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type)
---
> else
2650,2659c2647
<
< if (TREE_CODE (context) == NAMESPACE_DECL)
< {
< /* We can get here from typename_sub0 in the explicit_template_type
< expansion. Just fail. */
< if (complain & tf_error)
< error ("no class template named `%#T' in `%#T'",
< name, context);
< return error_mark_node;
< }
---
> my_friendly_assert (TYPE_P (context), 20050905);
4921a4910,4919
> if (DECL_EXTERNAL (decl) && init)
> {
> /* The static data member cannot be initialized by a
> non-constant when being declared. */
> error ("`%D' cannot be initialized by a non-constant expression"
> " when being declared", decl);
> DECL_INITIALIZED_IN_CLASS_P (decl) = 0;
> init = NULL_TREE;
> }
>
5721c5719
< grok_op_properties (decl, friendp, /*complain=*/true);
---
> grok_op_properties (decl, /*complain=*/true);
5895a5894
> tree explicit_scope;
5903c5902,5904
< /* Compute the scope in which to place the variable. */
---
> /* Compute the scope in which to place the variable, but remember
> whether or not that scope was explicitly specified by the user. */
> explicit_scope = scope;
5932,5933c5933,5934
< if (scope && TREE_CODE (scope) == NAMESPACE_DECL)
< set_decl_namespace (decl, scope, 0);
---
> if (explicit_scope && TREE_CODE (explicit_scope) == NAMESPACE_DECL)
> set_decl_namespace (decl, explicit_scope, 0);
7190,7191c7191,7192
< error ("member `%D' cannot be declared both virtual and static",
< dname);
---
> error ("member `%D' cannot be declared both virtual and static", dname);
> RIDBIT_RESET (RID_STATIC, specbits);
9007c9008
< grok_op_properties (tree decl, int friendp, bool complain)
---
> grok_op_properties (tree decl, bool complain)
9014a9016
> bool ellipsis_p;
9015a9018
> tree class_type;
9020c9023
< /* Count the number of arguments. */
---
> /* Count the number of arguments. and check for ellipsis */
9024a9028
> ellipsis_p = !argtype;
9026,9028c9030,9033
< if (current_class_type == NULL_TREE)
< friendp = 1;
<
---
> class_type = DECL_CONTEXT (decl);
> if (class_type && !CLASS_TYPE_P (class_type))
> class_type = NULL_TREE;
>
9056,9062c9061,9066
< if (! friendp)
< {
< switch (operator_code)
< {
< case NEW_EXPR:
< TYPE_HAS_NEW_OPERATOR (current_class_type) = 1;
< break;
---
> if (class_type)
> switch (operator_code)
> {
> case NEW_EXPR:
> TYPE_HAS_NEW_OPERATOR (class_type) = 1;
> break;
9064,9066c9068,9070
< case DELETE_EXPR:
< TYPE_GETS_DELETE (current_class_type) |= 1;
< break;
---
> case DELETE_EXPR:
> TYPE_GETS_DELETE (class_type) |= 1;
> break;
9068,9070c9072,9074
< case VEC_NEW_EXPR:
< TYPE_HAS_ARRAY_NEW_OPERATOR (current_class_type) = 1;
< break;
---
> case VEC_NEW_EXPR:
> TYPE_HAS_ARRAY_NEW_OPERATOR (class_type) = 1;
> break;
9072,9074c9076,9078
< case VEC_DELETE_EXPR:
< TYPE_GETS_DELETE (current_class_type) |= 2;
< break;
---
> case VEC_DELETE_EXPR:
> TYPE_GETS_DELETE (class_type) |= 2;
> break;
9076,9079c9080,9082
< default:
< break;
< }
< }
---
> default:
> break;
> }
9133c9136,9142
< if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl))
---
> /* Warn about conversion operators that will never be used. */
> if (IDENTIFIER_TYPENAME_P (name)
> && ! DECL_TEMPLATE_INFO (decl)
> && warn_conversion
> /* Warn only declaring the function; there is no need to
> warn again about out-of-class definitions. */
> && class_type == current_class_type)
9136c9145,9153
< if (! friendp)
---
> int ref = (TREE_CODE (t) == REFERENCE_TYPE);
> const char *what = 0;
>
> if (ref)
> t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
>
> if (TREE_CODE (t) == VOID_TYPE)
> what = "void";
> else if (class_type)
9138,9146c9155
< int ref = (TREE_CODE (t) == REFERENCE_TYPE);
< const char *what = 0;
<
< if (ref)
< t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
<
< if (TREE_CODE (t) == VOID_TYPE)
< what = "void";
< else if (t == current_class_type)
---
> if (t == class_type)
9151c9160
< && DERIVED_FROM_P (t, current_class_type))
---
> && DERIVED_FROM_P (t, class_type))
9153,9156d9161
<
< if (what && warn_conversion)
< warning ("conversion to %s%s will never use a type conversion operator",
< ref ? "a reference to " : "", what);
9157a9163,9166
>
> if (what)
> warning ("conversion to %s%s will never use a type conversion operator",
> ref ? "a reference to " : "", what);
9158a9168
>
9163a9174,9175
> else if (ellipsis_p)
> error ("`%D' must not have variable number of arguments", decl);
9328c9340
< return "union ";
---
> return "union";
9330a9343,9344
> case typename_type:
> return "typename";
9368c9382,9383
< if (!DECL_IMPLICIT_TYPEDEF_P (decl))
---
> if (!DECL_IMPLICIT_TYPEDEF_P (decl)
> && tag_code != typename_type)
9382c9397,9398
< && tag_code != enum_type)
---
> && tag_code != enum_type
> && tag_code != typename_type)
10304c10320,10324
< decl1 = push_template_decl (decl1);
---
> {
> tree newdecl1 = push_template_decl (decl1);
> if (newdecl1 != error_mark_node)
> decl1 = newdecl1;
> }
10317a10338,10339
> /* Make sure no default arg is missing. */
> check_default_args (decl1);
10381,10382d10402
< /* And make sure we have enough default args. */
< check_default_args (decl1);