diff options
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 89aedf3..7852572 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 3f48fae..0edade8 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -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. */ diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index e5763e7..6ee84a1 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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); } |