aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2008-02-25 23:59:44 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2008-02-25 23:59:44 +0000
commit683d6ff954e871028b34e8bd5e9fdda491ec2cbf (patch)
tree64878ef154456615c954564cc936b478852e6c76 /gcc/cp
parent369dcbd9d2f7d4577f689b46ee3028bc7949049c (diff)
downloadgcc-683d6ff954e871028b34e8bd5e9fdda491ec2cbf.zip
gcc-683d6ff954e871028b34e8bd5e9fdda491ec2cbf.tar.gz
gcc-683d6ff954e871028b34e8bd5e9fdda491ec2cbf.tar.bz2
c-common.c (match_case_to_enum_1): Add appropriate OPT_W* parameter to warning.
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * c-common.c (match_case_to_enum_1): Add appropriate OPT_W* parameter to warning. (c_do_switch_warnings): Likewise. * c-typeck.c (warning_init): Add one more parameter following 'warning' function. (push_init_level): Update call to warning_init. (pop_init_level): Likewise. (add_pending_init): Likewise. (output_init_element: Likewise. cp/ * typeck.c (build_class_member_access_expr): Add appropriate OPT_W* parameter to warning. (build_reinterpret_cast_1): Likewise. * name-lookup.c (push_overloaded_decl): Likewise. testsuite/ * gcc.dg/Wswitch-enum-error.c: New. * gcc.dg/Wswitch-error.c: New. * gcc.dg/20011021-1.c: Use two directives to match two different messages. From-SVN: r132649
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/name-lookup.c2
-rw-r--r--gcc/cp/typeck.c13
3 files changed, 15 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 388b2c0..2738490 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * typeck.c (build_class_member_access_expr): Add appropriate
+ OPT_W* parameter to warning.
+ (build_reinterpret_cast_1): Likewise.
+ * name-lookup.c (push_overloaded_decl): Likewise.
+
2008-02-25 Paolo Carlini <pcarlini@suse.de>
PR c++/35333
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 4a43cfa..74a25bd 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -1919,7 +1919,7 @@ push_overloaded_decl (tree decl, int flags, bool is_friend)
if (IS_AGGR_TYPE (t) && warn_shadow
&& (! DECL_IN_SYSTEM_HEADER (decl)
|| ! DECL_IN_SYSTEM_HEADER (old)))
- warning (0, "%q#D hides constructor for %q#T", decl, t);
+ warning (OPT_Wshadow, "%q#D hides constructor for %q#T", decl, t);
old = NULL_TREE;
}
else if (is_overloaded_fn (old))
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 81fbe77..bb8d71c 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -1934,9 +1934,11 @@ build_class_member_access_expr (tree object, tree member,
&& !DECL_FIELD_IS_BASE (member)
&& !skip_evaluation)
{
- warning (0, "invalid access to non-static data member %qD of NULL object",
- member);
- warning (0, "(perhaps the %<offsetof%> macro was used incorrectly)");
+ warning (OPT_Winvalid_offsetof,
+ "invalid access to non-static data member %qD "
+ " of NULL object", member);
+ warning (OPT_Winvalid_offsetof,
+ "(perhaps the %<offsetof%> macro was used incorrectly)");
}
/* If MEMBER is from an anonymous aggregate, we have converted
@@ -5337,9 +5339,8 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
&& COMPLETE_TYPE_P (TREE_TYPE (type))
&& COMPLETE_TYPE_P (TREE_TYPE (intype))
&& TYPE_ALIGN (TREE_TYPE (type)) > TYPE_ALIGN (TREE_TYPE (intype)))
- warning (0, "cast from %qT to %qT increases required alignment of "
- "target type",
- intype, type);
+ warning (OPT_Wcast_align, "cast from %qT to %qT "
+ "increases required alignment of target type", intype, type);
/* We need to strip nops here, because the front end likes to
create (int *)&a for array-to-pointer decay, instead of &a[0]. */