summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/decl.c20
-rw-r--r--gcc/cp/name-lookup.c2
-rw-r--r--gcc/cp/parser.c6
-rw-r--r--gcc/cp/tree.c3
5 files changed, 27 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 524c943b171..aa8b26c4a11 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2005-05-25 DJ Delorie <dj@redhat.com>
+
+ * decl.c (duplicate_decls): Move warning control from if() to
+ warning(OPT_*).
+ * name-lookup.c (parse_using_directive): Likewise.
+ * parser.c (cp_parser_elaborated_type_specifier): Likewise.
+ (cp_parser_init_declarator): Likewise.
+ * tree.c (handle_com_interface_attribute): Likewise.
+
2005-05-24 Ziemowit Laski <zlaski@apple.com>
* class.c (layout_class_type): Do not issue C++ ABI warnings
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0da99373e81..d3544172bc4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1051,17 +1051,18 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_UNINLINABLE (olddecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl)))
{
- warning (0, "%Jfunction %qD redeclared as inline", newdecl, newdecl);
- warning (0, "%Jprevious declaration of %qD with attribute noinline",
- olddecl, olddecl);
+ warning (OPT_Wattributes, "%Jfunction %qD redeclared as inline",
+ newdecl, newdecl);
+ warning (OPT_Wattributes, "%Jprevious declaration of %qD "
+ "with attribute noinline", olddecl, olddecl);
}
else if (DECL_DECLARED_INLINE_P (olddecl)
&& DECL_UNINLINABLE (newdecl)
&& lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl)))
{
- warning (0, "%Jfunction %qD redeclared with attribute noinline",
- newdecl, newdecl);
- warning (0, "%Jprevious declaration of %qD was inline",
+ warning (OPT_Wattributes, "%Jfunction %qD redeclared with "
+ "attribute noinline", newdecl, newdecl);
+ warning (OPT_Wattributes, "%Jprevious declaration of %qD was inline",
olddecl, olddecl);
}
}
@@ -1802,9 +1803,10 @@ duplicate_decls (tree newdecl, tree olddecl)
&& DECL_VISIBILITY_SPECIFIED (newdecl)
&& DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
{
- warning (0, "%J%qD: visibility attribute ignored because it",
- newdecl, newdecl);
- warning (0, "%Jconflicts with previous declaration here", olddecl);
+ warning (OPT_Wattributes, "%J%qD: visibility attribute ignored "
+ "because it", newdecl, newdecl);
+ warning (OPT_Wattributes, "%Jconflicts with previous "
+ "declaration here", olddecl);
}
/* Choose the declaration which specified visibility. */
if (DECL_VISIBILITY_SPECIFIED (olddecl))
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 0bb8888e8a3..bd83695cd0a 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3207,7 +3207,7 @@ parse_using_directive (tree namespace, tree attribs)
DECL_NAMESPACE_ASSOCIATIONS (namespace));
}
else
- warning (0, "%qD attribute directive ignored", name);
+ warning (OPT_Wattributes, "%qD attribute directive ignored", name);
}
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 2527fb2f551..a0d71b3141f 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -10024,7 +10024,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
/* Warn about attributes. They are ignored. */
if (attributes)
- warning (0, "type attributes are honored only at type definition");
+ warning (OPT_Wattributes,
+ "type attributes are honored only at type definition");
type = xref_tag (tag_type, identifier, ts,
parser->num_template_parameter_lists);
@@ -10869,7 +10870,8 @@ cp_parser_init_declarator (cp_parser* parser,
attributes -- but ignores them. */
if (cp_parser_allow_gnu_extensions_p (parser) && is_parenthesized_init)
if (cp_parser_attributes_opt (parser))
- warning (0, "attributes after parenthesized initializer ignored");
+ warning (OPT_Wattributes,
+ "attributes after parenthesized initializer ignored");
/* For an in-class declaration, use `grokfield' to create the
declaration. */
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 114275cd419..64a5aa5bd25 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1769,7 +1769,8 @@ handle_com_interface_attribute (tree* node,
|| !CLASS_TYPE_P (*node)
|| *node != TYPE_MAIN_VARIANT (*node))
{
- warning (0, "%qE attribute can only be applied to class definitions", name);
+ warning (OPT_Wattributes, "%qE attribute can only be applied "
+ "to class definitions", name);
return NULL_TREE;
}