aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-08 23:32:23 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-08 23:32:23 +0000
commitc73d5dd948d68fb2550f7d178d1483aebcfbcaea (patch)
treebc97d77632044f39e89c6f57ff0998acec035a7c /gcc/cp/class.c
parent63a3341a9d1f760b1761b365f57a27523bfb548b (diff)
downloadgcc-c73d5dd948d68fb2550f7d178d1483aebcfbcaea.zip
gcc-c73d5dd948d68fb2550f7d178d1483aebcfbcaea.tar.gz
gcc-c73d5dd948d68fb2550f7d178d1483aebcfbcaea.tar.bz2
re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)
2008-08-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 7651 * doc/invoke.texi (-Wextra): Move warning from here... (-Wuninitialized): ... to here. cp/ * class.c (check_bases_and_members): Warn with -Wuninitialized instead of -Wextra. testsuite/ * g++.dg/warn/Wuninitializable-member.C: New. * g++.dg/warn/Wuninitializable-member-no.C: New. From-SVN: r138892
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index f7e46a7..b08f9c8 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -4306,7 +4306,7 @@ check_bases_and_members (tree t)
/* If the class has no user-declared constructor, but does have
non-static const or reference data members that can never be
initialized, issue a warning. */
- if (extra_warnings
+ if (warn_uninitialized
/* Classes with user-declared constructors are presumed to
initialize these members. */
&& !TYPE_HAS_USER_CONSTRUCTOR (t)
@@ -4325,13 +4325,13 @@ check_bases_and_members (tree t)
type = TREE_TYPE (field);
if (TREE_CODE (type) == REFERENCE_TYPE)
- warning (OPT_Wextra, "non-static reference %q+#D in class "
- "without a constructor", field);
+ warning (OPT_Wuninitialized, "non-static reference %q+#D "
+ "in class without a constructor", field);
else if (CP_TYPE_CONST_P (type)
&& (!CLASS_TYPE_P (type)
|| !TYPE_HAS_DEFAULT_CONSTRUCTOR (type)))
- warning (OPT_Wextra, "non-static const member %q+#D in class "
- "without a constructor", field);
+ warning (OPT_Wuninitialized, "non-static const member %q+#D "
+ "in class without a constructor", field);
}
}