c-common.c (c_common_truthvalue_conversion): Don't warn if TREE_NO_WARNING is set.
authorSteven Bosscher <stevenb@suse.de>
Sun, 18 Jul 2004 23:57:31 +0000 (23:57 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Sun, 18 Jul 2004 23:57:31 +0000 (23:57 +0000)
* c-common.c (c_common_truthvalue_conversion): Don't warn if
TREE_NO_WARNING is set.

cp/
* cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
* decl2.c (grokfield): Don't check current_class_depth via
unused TREE_COMPLEXITY.
* semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
to avoid the missing parentheses warning.
Don't set C_SET_EXP_ORIGINAL_CODE.

Co-Authored-By: Joseph Myers <jsm@polyomino.org.uk>
From-SVN: r84903

gcc/ChangeLog
gcc/c-common.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/semantics.c

index b62a65c4e81c9cc5c6ab6570063831cf97447a4a..fcd9dc965db9113aaef1a1b49e7a2f4d141ad35e 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-10  Steven Bosscher  <stevenb@suse.de>
+           Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       * c-common.c (c_common_truthvalue_conversion): Don't warn if
+       TREE_NO_WARNING is set.
+
 2004-07-18  Roger Sayle  <roger@eyesopen.com>
 
        * builtins.c (simplify_builtin_memcmp, simplify_builtin_strcmp,
index cc743cc9da82d1a3951f66d51a4e022eadf2cce7..b729fd89207ca6f607a7fbeedeeafc0b06a5bff1 100644 (file)
@@ -2365,7 +2365,9 @@ c_common_truthvalue_conversion (tree expr)
       break;
 
     case MODIFY_EXPR:
-      if (warn_parentheses && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR)
+      if (warn_parentheses
+         && C_EXP_ORIGINAL_CODE (expr) == MODIFY_EXPR
+         && !TREE_NO_WARNING (expr))
        warning ("suggest parentheses around assignment used as truth value");
       break;
 
index 97da2dda020496ff9ded80bea8d2bf0499449ef7..cdbdc42a41dfecfa2f620fd10dc16d8d9973cb44 100644 (file)
@@ -1,3 +1,13 @@
+2004-07-10  Steven Bosscher  <stevenb@suse.de>
+           Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       * cp-tree.h (C_SET_EXP_ORIGINAL_CODE): Remove.
+       * decl2.c (grokfield): Don't check current_class_depth via
+       unused TREE_COMPLEXITY.
+       * semantics.c (finish_parenthesized_expr): Set TREE_NO_WARNING
+       to avoid the missing parentheses warning.
+       Don't set C_SET_EXP_ORIGINAL_CODE.
+
 2004-07-18  Mark Mitchell  <mark@codesourcery.com>
 
        * mangle.c (write_expression): Issue a sorry for zero-operand
index 7ed1d5f0de4b2a31a4b93fc26ecfffde64366365..ca7eae30f3b5605c5d67338a1532c3ef4cac16d0 100644 (file)
@@ -370,10 +370,6 @@ typedef enum cp_id_kind
 #define C_TYPE_FIELDS_READONLY(TYPE) \
   (LANG_TYPE_CLASS_CHECK (TYPE)->fields_readonly)
 
-/* Store a value in that field.  */
-#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
-  (TREE_COMPLEXITY (EXP) = (int)(CODE))
-
 /* The tokens stored in the default argument.  */
 
 #define DEFARG_TOKENS(NODE) \
index 7257f696952bca817ee7f52655413e8a0ab01862..ea9aa49c13c574fb36c08f575876ecf3f87f91d3 100644 (file)
@@ -816,15 +816,8 @@ grokfield (const cp_declarator *declarator,
       && TREE_CODE (declarator->u.id.name) == SCOPE_REF
       && (TREE_CODE (TREE_OPERAND (declarator->u.id.name, 1)) 
          == IDENTIFIER_NODE))
-    {
-      /* Access declaration */
-      if (! IS_AGGR_TYPE_CODE (TREE_CODE 
-                              (TREE_OPERAND (declarator->u.id.name, 0))))
-       ;
-      else if (TREE_COMPLEXITY (declarator->u.id.name) == current_class_depth)
-       pop_nested_class ();
-      return do_class_using_decl (declarator->u.id.name);
-    }
+    /* Access declaration */
+    return do_class_using_decl (declarator->u.id.name);
 
   if (init
       && TREE_CODE (init) == TREE_LIST
index 6bc7e68f298e9587176942c72649caa3725dec33..3d8c643585361cd18d34e007a071b0648e86e5f2 100644 (file)
@@ -1231,7 +1231,7 @@ finish_parenthesized_expr (tree expr)
 {
   if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expr))))
     /* This inhibits warnings in c_common_truthvalue_conversion.  */
-    C_SET_EXP_ORIGINAL_CODE (expr, ERROR_MARK); 
+    TREE_NO_WARNING (expr) = 1;
 
   if (TREE_CODE (expr) == OFFSET_REF)
     /* [expr.unary.op]/3 The qualified id of a pointer-to-member must not be