PATCH: Fix warning in call.c

Mark Mitchell mark@codesourcery.com
Tue Jul 1 18:49:00 GMT 2003


One of recent check-ins caused a new warning in call.c; here's the
fix.

Applied on the branch and the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-07-01  Mark Mitchell  <mark@codesourcery.com>

	* call.c (resolve_scoped_fn_name): Return error_mark_node for
	erroneous cases.

Index: call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.395
retrieving revision 1.396
diff -c -5 -p -r1.395 -r1.396
*** call.c	1 Jul 2003 17:35:59 -0000	1.395
--- call.c	1 Jul 2003 18:48:36 -0000	1.396
*************** resolve_scoped_fn_name (tree scope, tree
*** 2764,2774 ****
      name = TREE_OPERAND (name, 0);
    
    if (TREE_CODE (scope) == NAMESPACE_DECL)
      fn = lookup_namespace_name (scope, name);
    else if (!CLASS_TYPE_P (scope))
!     error ("`%T' is not a class type", scope);
    else
      {
        if (!TYPE_BEING_DEFINED (scope)
  	  && !COMPLETE_TYPE_P (complete_type (scope)))
  	{
--- 2764,2777 ----
      name = TREE_OPERAND (name, 0);
    
    if (TREE_CODE (scope) == NAMESPACE_DECL)
      fn = lookup_namespace_name (scope, name);
    else if (!CLASS_TYPE_P (scope))
!     {
!       error ("`%T' is not a class type", scope);
!       return error_mark_node;
!     }
    else
      {
        if (!TYPE_BEING_DEFINED (scope)
  	  && !COMPLETE_TYPE_P (complete_type (scope)))
  	{



More information about the Gcc-patches mailing list