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]

[RFA PATCH] Remove redundant (?) test


cp/decl.c:build_enumerator starts with a chunk of code that looks like this
(with some markers in the left column):

 *  if (! processing_template_decl)
      {
        /* Validate and default VALUE.  */
        if (value != NULL_TREE)
          {
            value = decl_constant_value (value);
  
            if (TREE_CODE (value) == INTEGER_CST)
              {
                value = default_conversion (value);
                constant_expression_warning (value);
              }
            else
              {
                error ("enumerator value for `%D' not integer constant", name);
                value = NULL_TREE;
              }
          }
  
        /* Default based on previous value.  */
 *      if (value == NULL_TREE && ! processing_template_decl)
        ......

Note that * #2 is inside the block tested by * #1.  Is there anything in
that first block that can change the value of processing_template_decl?
(I don't /think/ there is.)

This has been building in my local tree for a while.  No regressions.
Okay for trunk?


2003-02-10  Phil Edwards  <pme@gcc.gnu.org>

	* decl.c (build_enumerator):  Remove unneeded test.


Index: decl.c
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/gcc/cp/decl.c,v
retrieving revision 1.993
diff -u -3 -p -r1.993 decl.c
--- decl.c	30 Jan 2003 16:02:56 -0000	1.993
+++ decl.c	10 Feb 2003 20:32:40 -0000
@@ -13147,7 +13147,7 @@ build_enumerator (tree name, tree value,
 	}
 
       /* Default based on previous value.  */
-      if (value == NULL_TREE && ! processing_template_decl)
+      if (value == NULL_TREE)
 	{
 	  tree prev_value;
 


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