PR c++/26114, c++/26115
authorJanis Johnson <janis187@us.ibm.com>
Mon, 17 Apr 2006 19:35:56 +0000 (19:35 +0000)
committerJanis Johnson <janis@gcc.gnu.org>
Mon, 17 Apr 2006 19:35:56 +0000 (19:35 +0000)
PR c++/26114, c++/26115
* typeck.c (cxx_mark_addressable): Restore check for extra_warnings.
* class.c (check_field_decls): Ditto.

From-SVN: r113010

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/typeck.c

index 89aedf3e8cf3b1a144f8717746aa896f5a2f7d3f..78525726ecb935d6b3190097bf470dc1cdd516f1 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-17  Janis Johnson  <janis187@us.ibm.com>
+
+       PR c++/26114, c++/26115
+       * typeck.c (cxx_mark_addressable): Restore check for extra_warnings.
+       * class.c (check_field_decls): Ditto.
+
 2006-04-17  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        * init.c (build_offset_ref): Remove superfluous temporary.
index 3f48faeb4eca5f5df9f07ea6c7845e277fd7ce2a..0edade8863124c85823ab9310ed151aea30dd741 100644 (file)
@@ -2935,7 +2935,8 @@ check_field_decls (tree t, tree *access_decls,
             members.  */
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
-         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t))
+         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
+             && extra_warnings)
            warning (OPT_Wextra, "non-static reference %q+#D in class without a constructor", x);
        }
 
@@ -2981,7 +2982,8 @@ check_field_decls (tree t, tree *access_decls,
             members.  */
          TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
 
-         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t))
+         if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t)
+             && extra_warnings)
            warning (OPT_Wextra, "non-static const member %q+#D in class without a constructor", x);
        }
       /* A field that is pseudo-const makes the structure likewise.  */
index e5763e7a8d341acc249daad533e9c774398745a4..6ee84a112625e59909f4b1b09865ddbe558a9650 100644 (file)
@@ -4496,7 +4496,7 @@ cxx_mark_addressable (tree exp)
                  ("address of explicit register variable %qD requested", x);
                return false;
              }
-           else
+           else if (extra_warnings)
              warning
                (OPT_Wextra, "address requested for %qD, which is declared %<register%>", x);
          }