This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for various warnings in gcc


OK here is the warning patch.
The checking gives:

        === g++ tests ===


Running target unix
FAIL: g++.dg/warn/Wunused-2.C  (test for warnings, line 5)
FAIL: g++.ext/pretty2.C  Execution test

        === g++ Summary ===

# of expected passes        7488
# of unexpected failures    2
# of expected failures      86
# of untested testcases     9
# of unsupported tests      3
/0/robotvis/papadop/src/Compiles/gcc-linux/gcc/testsuite/../g++ version 3.3 20020808 (experimental)^M

The first FAIL is normal, I cannot see the second in other results. 
As anyone seen this ??? I cannot imagine that the patch is wrong.... 
but as usual ten verifications are better than one.

In case this is OK, here is the full patch for both decl2.c and 
parse.y:

ChangeLog for gcc/cp:

2002-08-08 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>

    * decl2.c (build_offset_ref_call_from_tree) Fix warning.
    * parse.y (parse_finish_call_expr) Likewise.

Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.557
diff -c -3 -p -r1.557 decl2.c
*** decl2.c	8 Aug 2002 05:48:36 -0000	1.557
--- decl2.c	8 Aug 2002 19:01:28 -0000
*************** build_offset_ref_call_from_tree (tree fn
*** 3477,3483 ****
  tree
  build_call_from_tree (tree fn, tree args, bool disallow_virtual)
  {
-   tree template_args;
    tree template_id;
    tree f;
    
--- 3477,3482 ----
*************** build_call_from_tree (tree fn, tree args
*** 3493,3499 ****
    if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
      {
        template_id = fn;
-       template_args = TREE_OPERAND (fn, 1);
        fn = TREE_OPERAND (fn, 0);
      }
    else
--- 3492,3497 ----
*************** build_call_from_tree (tree fn, tree args
*** 3517,3525 ****
--- 3515,3526 ----
    if (template_id)
      {
        if (BASELINK_P (fn))
+         {
+           tree template_args = TREE_OPERAND (template_id, 1);
  	  BASELINK_FUNCTIONS (fn) = build_nt (TEMPLATE_ID_EXPR, 
  					      BASELINK_FUNCTIONS (fn),
  					      template_args);
+         }
        else
  	fn = template_id;
      }
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/parse.y,v
retrieving revision 1.275
diff -c -3 -p -r1.275 parse.y
*** parse.y	8 Aug 2002 05:48:36 -0000	1.275
--- parse.y	8 Aug 2002 19:01:28 -0000
*************** static tree
*** 4110,4116 ****
  parse_finish_call_expr (tree fn, tree args, int koenig)
  {
    bool disallow_virtual;
-   tree template_args;
    tree template_id;
    tree f;
  
--- 4110,4115 ----
*************** parse_finish_call_expr (tree fn, tree ar
*** 4136,4142 ****
  	      if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
  		{
  		  template_id = name;
- 		  template_args = TREE_OPERAND (name, 1);
  		  name = TREE_OPERAND (name, 0);
  		}
  	      else 
--- 4135,4140 ----
*************** parse_finish_call_expr (tree fn, tree ar
*** 4151,4160 ****
  		  fn = lookup_member (scope, name, /*protect=*/1, 
  				      /*prefer_type=*/0);
  		  if (BASELINK_P (fn) && template_id)
! 		    BASELINK_FUNCTIONS (fn) 
! 		      = build_nt (TEMPLATE_ID_EXPR,
! 				  BASELINK_FUNCTIONS (fn),
! 				  template_args);
  		}
  	      if (BASELINK_P (fn) 
  		  && current_class_type 
--- 4149,4161 ----
  		  fn = lookup_member (scope, name, /*protect=*/1, 
  				      /*prefer_type=*/0);
  		  if (BASELINK_P (fn) && template_id)
!                     {
!                       tree template_args = TREE_OPERAND (template_id, 1);
! 		      BASELINK_FUNCTIONS (fn) 
! 		        = build_nt (TEMPLATE_ID_EXPR,
! 				    BASELINK_FUNCTIONS (fn),
! 				    template_args);
!                     }
  		}
  	      if (BASELINK_P (fn) 
  		  && current_class_type 


--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]