aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-21 10:55:13 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2008-08-21 10:55:13 +0000
commit509c9d60e430b84903eb1232a70871aa93150623 (patch)
tree83b0791500b25a6c18b622d8641f3ac55eb3f00b /gcc/cp
parent2fb63453bdd24fff367b4ddb18c59b3972520728 (diff)
downloadgcc-509c9d60e430b84903eb1232a70871aa93150623.zip
gcc-509c9d60e430b84903eb1232a70871aa93150623.tar.gz
gcc-509c9d60e430b84903eb1232a70871aa93150623.tar.bz2
diagnostic.c (pedwarn_at): Rename as pedwarn.
2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * diagnostic.c (pedwarn_at): Rename as pedwarn. (pedwarn): Delete. * toplev.h (pedwarn_at): Likewise. * builtins.c: Update all calls to pedwarn. * c-lex.c: Likewise. * toplev.c: Likewise. * c-tree.h: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-typeck.c: Likewise. * c-common.c: Likewise. * c-parser.c: Likewise. cp/ * typeck.c: Update all calls to pedwarn. * decl.c: Likewise. * call.c: Likewise. * error.c: Likewise. * pt.c: Likewise. * name-lookup.c: Likewise. * parser.c: Likewise. fortran/ * f95-lang.c: Update all calls to pedwarn. From-SVN: r139373
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/call.c4
-rw-r--r--gcc/cp/decl.c26
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/name-lookup.c8
-rw-r--r--gcc/cp/parser.c22
-rw-r--r--gcc/cp/pt.c13
-rw-r--r--gcc/cp/typeck.c12
8 files changed, 53 insertions, 44 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a8a212f..9125194 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * typeck.c: Update all calls to pedwarn.
+ * decl.c: Likewise.
+ * call.c: Likewise.
+ * error.c: Likewise.
+ * pt.c: Likewise.
+ * name-lookup.c: Likewise.
+ * parser.c: Likewise.
+
2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/35158
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 0348eb1..90fa20a 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3404,7 +3404,7 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
if (!arg2)
{
if (complain & tf_error)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids omitting the middle term of a ?: expression");
/* Make sure that lvalues remain lvalues. See g++.oliva/ext1.C. */
@@ -6766,7 +6766,7 @@ tweak:
{
if (warn)
{
- pedwarn (0,
+ pedwarn (input_location, 0,
"ISO C++ says that these are ambiguous, even "
"though the worst conversion for the first is better than "
"the worst conversion for the second:");
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 34059ff..ec4fa76 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3810,7 +3810,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
SET_ANON_AGGR_TYPE_P (declared_type);
if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header)
- pedwarn (OPT_pedantic, "ISO C++ prohibits anonymous structs");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ prohibits anonymous structs");
}
else
@@ -7033,7 +7033,7 @@ check_static_variable_definition (tree decl, tree type)
"static member %qD",
decl);
else if (!INTEGRAL_TYPE_P (type))
- pedwarn (OPT_pedantic, "ISO C++ forbids initialization of member constant "
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids initialization of member constant "
"%qD of non-integral type %qT", decl, type);
return 0;
@@ -7113,9 +7113,9 @@ compute_array_index_type (tree name, tree size)
else if (integer_zerop (size) && !in_system_header)
{
if (name)
- pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
else
- pedwarn (OPT_pedantic, "ISO C++ forbids zero-size array");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array");
}
}
else if (TREE_CONSTANT (size))
@@ -7131,9 +7131,9 @@ compute_array_index_type (tree name, tree size)
else if (pedantic && warn_vla != 0)
{
if (name)
- pedwarn (OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
else
- pedwarn (OPT_Wvla, "ISO C++ forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array");
}
else if (warn_vla > 0)
{
@@ -7767,7 +7767,7 @@ grokdeclarator (const cp_declarator *declarator,
else if (! is_main)
permerror (input_location, "ISO C++ forbids declaration of %qs with no type", name);
else if (pedantic)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids declaration of %qs with no type", name);
else
warning (OPT_Wreturn_type,
@@ -7823,7 +7823,7 @@ grokdeclarator (const cp_declarator *declarator,
ok = 1;
if (!explicit_int && !defaulted_int && !explicit_char && pedantic)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"long, short, signed or unsigned used invalidly for %qs",
name);
if (flag_pedantic_errors)
@@ -7929,7 +7929,7 @@ grokdeclarator (const cp_declarator *declarator,
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
@@ -9159,11 +9159,11 @@ grokdeclarator (const cp_declarator *declarator,
&& pedantic)
{
if (storage_class == sc_static)
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%<static%> specified invalid for function %qs "
"declared out of global scope", name);
else
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"%<inline%> specifier invalid for function %qs "
"declared out of global scope", name);
}
@@ -9252,7 +9252,7 @@ grokdeclarator (const cp_declarator *declarator,
}
if (storage_class == sc_extern && pedantic)
{
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"cannot explicitly declare member %q#D to have "
"extern linkage", decl);
storage_class = sc_none;
@@ -10148,7 +10148,7 @@ grok_op_properties (tree decl, bool complain)
if (operator_code == POSTINCREMENT_EXPR
|| operator_code == POSTDECREMENT_EXPR)
{
- pedwarn (OPT_pedantic, "%qD cannot have default arguments",
+ pedwarn (input_location, OPT_pedantic, "%qD cannot have default arguments",
decl);
}
else
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 177d082..395ede2 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2687,7 +2687,7 @@ maybe_warn_cpp0x (const char* str)
/* We really want to suppress this warning in system headers,
because libstdc++ uses variadic templates even when we aren't
in C++0x mode. */
- pedwarn (0, "%s only available with -std=c++0x or -std=gnu++0x", str);
+ pedwarn (input_location, 0, "%s only available with -std=c++0x or -std=gnu++0x", str);
}
/* Warn about the use of variadic templates when appropriate. */
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index e1c57b4..c9a7e60 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -725,7 +725,7 @@ pushdecl_maybe_friend (tree x, bool is_friend)
else if (t == wchar_decl_node)
{
if (! DECL_IN_SYSTEM_HEADER (x))
- pedwarn (OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
+ pedwarn (input_location, OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
TREE_TYPE (x));
/* Throw away the redeclaration. */
@@ -796,11 +796,11 @@ pushdecl_maybe_friend (tree x, bool is_friend)
x_exception_spec,
true))
{
- pedwarn (0, "declaration of %q#D with C language linkage",
+ pedwarn (input_location, 0, "declaration of %q#D with C language linkage",
x);
- pedwarn (0, "conflicts with previous declaration %q+#D",
+ pedwarn (input_location, 0, "conflicts with previous declaration %q+#D",
previous);
- pedwarn (0, "due to different exception specifications");
+ pedwarn (input_location, 0, "due to different exception specifications");
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index ccbecd7..357d1cb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -2162,9 +2162,8 @@ cp_parser_check_decl_spec (cp_decl_specifier_seq *decl_specs,
error ("%H%<long long long%> is too long for GCC", &location);
else if (pedantic && !in_system_header && warn_long_long
&& cxx_dialect == cxx98)
- pedwarn (OPT_Wlong_long,
- "%HISO C++ 1998 does not support %<long long%>",
- &location);
+ pedwarn (location, OPT_Wlong_long,
+ "ISO C++ 1998 does not support %<long long%>");
}
else if (count > 1)
{
@@ -3217,9 +3216,8 @@ cp_parser_primary_expression (cp_parser *parser,
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
{
/* Statement-expressions are not allowed by the standard. */
- pedwarn (OPT_pedantic,
- "%HISO C++ forbids braced-groups within expressions",
- &token->location);
+ pedwarn (token->location, OPT_pedantic,
+ "ISO C++ forbids braced-groups within expressions");
/* And they're not allowed outside of a function-body; you
cannot, for example, write:
@@ -4548,7 +4546,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
{
/* Warn the user that a compound literal is not
allowed in standard C++. */
- pedwarn (OPT_pedantic, "ISO C++ forbids compound-literals");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids compound-literals");
/* For simplicity, we disallow compound literals in
constant-expressions. We could
allow compound literals of integer type, whose
@@ -7612,7 +7610,7 @@ cp_parser_jump_statement (cp_parser* parser)
if (cp_lexer_next_token_is (parser->lexer, CPP_MULT))
{
/* Issue a warning about this use of a GNU extension. */
- pedwarn (OPT_pedantic, "%HISO C++ forbids computed gotos", &token->location);
+ pedwarn (token->location, OPT_pedantic, "ISO C++ forbids computed gotos");
/* Consume the '*' token. */
cp_lexer_consume_token (parser->lexer);
/* Parse the dependent expression. */
@@ -7752,7 +7750,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
invalid. Allow it unless we're being pedantic. */
cp_lexer_consume_token (parser->lexer);
if (!in_system_header)
- pedwarn (OPT_pedantic, "extra %<;%>");
+ pedwarn (input_location, OPT_pedantic, "extra %<;%>");
continue;
}
@@ -11740,7 +11738,7 @@ cp_parser_enumerator_list (cp_parser* parser, tree type)
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
if (!in_system_header)
- pedwarn (OPT_pedantic, "comma at end of enumerator list");
+ pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list");
break;
}
}
@@ -14384,7 +14382,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
&& cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_COLON)
{
/* Warn the user that they are using an extension. */
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ does not allow designated initializers");
/* Consume the identifier. */
identifier = cp_lexer_consume_token (parser->lexer)->u.value;
@@ -15408,7 +15406,7 @@ cp_parser_member_declaration (cp_parser* parser)
{
cp_token *token = cp_lexer_peek_token (parser->lexer);
if (!in_system_header_at (token->location))
- pedwarn (OPT_pedantic, "%Hextra %<;%>", &token->location);
+ pedwarn (token->location, OPT_pedantic, "extra %<;%>");
}
else
{
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 4df53e8..43cf2b9 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -14613,7 +14613,7 @@ do_decl_instantiation (tree decl, tree storage)
else if (storage == ridpointers[(int) RID_EXTERN])
{
if (!in_system_header && (cxx_dialect == cxx98))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations");
extern_p = 1;
@@ -14705,13 +14705,14 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (storage == ridpointers[(int) RID_EXTERN])
{
if (cxx_dialect == cxx98)
- pedwarn(OPT_pedantic,
- "ISO C++ 1998 forbids the use of %<extern%> on "
- "explicit instantiations");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ 1998 forbids the use of %<extern%> on "
+ "explicit instantiations");
}
else
- pedwarn(OPT_pedantic, "ISO C++ forbids the use of %qE on explicit "
- "instantiations", storage);
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids the use of %qE"
+ " on explicit instantiations", storage);
}
if (storage == ridpointers[(int) RID_INLINE])
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index f955efe..df126e8 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -512,7 +512,7 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree result_type;
if (TYPE_PTRFN_P (t2) && (complain & tf_error))
- pedwarn (OPT_pedantic, "ISO C++ forbids %s "
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids %s "
"between pointer of type %<void *%> and pointer-to-function",
location);
result_type
@@ -1280,7 +1280,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
if (TREE_CODE (type) == METHOD_TYPE)
{
if (complain)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
"invalid application of %qs to a member function",
operator_name_info[(int) op].name);
value = size_one_node;
@@ -2587,7 +2587,7 @@ build_array_ref (tree array, tree idx)
}
if (!lvalue_p (array))
- pedwarn (OPT_pedantic, "ISO C++ forbids subscripting non-lvalue array");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids subscripting non-lvalue array");
/* Note in C++ it is valid to subscript a `register' array, since
it is valid to take the address of something with that
@@ -2813,7 +2813,7 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
/* Convert anything with function type to a pointer-to-function. */
if (DECL_MAIN_P (function) && (complain & tf_error))
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ISO C++ forbids calling %<::main%> from within program");
function = build_addr_func (function);
@@ -5260,7 +5260,7 @@ convert_member_func_to_ptr (tree type, tree expr)
|| TREE_CODE (intype) == METHOD_TYPE);
if (pedantic || warn_pmf2ptr)
- pedwarn (pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
"converting from %qT to %qT", intype, type);
if (TREE_CODE (intype) == METHOD_TYPE)
@@ -7164,7 +7164,7 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl)
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn (OPT_pedantic,
+ pedwarn (input_location, OPT_pedantic,
"ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}