aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog18
-rw-r--r--gcc/cp/call.c14
-rw-r--r--gcc/cp/class.c26
-rw-r--r--gcc/cp/cvt.c14
-rw-r--r--gcc/cp/decl.c7
-rw-r--r--gcc/cp/error.c2
-rw-r--r--gcc/cp/lex.c8
-rw-r--r--gcc/cp/parser.c2
8 files changed, 52 insertions, 39 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6f61262..3c79d1d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,21 @@
+2008-03-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 24924
+ * class.c (finish_struct_anon): Use permerror instead of pedwarn.
+ (check_field_decls): Likewise.
+ (note_name_declared_in_class): Likewise.
+ * call.c (build_new_op): Likewise.
+ (convert_like_real): Likewise.
+ (build_over_call): Likewise.
+ * lex.c (unqualified_fn_lookup_error): Likewise.
+ * parser.c (cp_parser_template_id): Likewise.
+ * cvt.c (warn_ref_binding): Likewise.
+ (convert_to_reference): Likewise.
+ (ocp_convert): Likewise.
+ (convert_to_void): Use error instead of pedwarn.
+ * error.c (cp_cpp_error): Use pedantic_warning_kind.
+ * decl.c (compute_array_index_type): Use constant_expression_error.
+
2008-03-01 Douglas Gregor <doug.gregor@gmail.com>
* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Note
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index a61638c..2ee8237 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3857,10 +3857,10 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3,
/* Look for an `operator++ (int)'. If they didn't have
one, then we fall back to the old way of doing things. */
if (flags & LOOKUP_COMPLAIN)
- pedwarn ("no %<%D(int)%> declared for postfix %qs, "
- "trying prefix operator instead",
- fnname,
- operator_name_info[code].name);
+ permerror ("no %<%D(int)%> declared for postfix %qs, "
+ "trying prefix operator instead",
+ fnname,
+ operator_name_info[code].name);
if (code == POSTINCREMENT_EXPR)
code = PREINCREMENT_EXPR;
else
@@ -4343,9 +4343,9 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
else if (t->kind == ck_identity)
break;
}
- pedwarn ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
+ permerror ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
if (fn)
- pedwarn (" initializing argument %P of %qD", argnum, fn);
+ permerror (" initializing argument %P of %qD", argnum, fn);
return cp_convert (totype, expr);
}
@@ -4955,7 +4955,7 @@ build_over_call (struct z_candidate *cand, int flags)
tree base_binfo;
if (convs[i]->bad_p)
- pedwarn ("passing %qT as %<this%> argument of %q#D discards qualifiers",
+ permerror ("passing %qT as %<this%> argument of %q#D discards qualifiers",
TREE_TYPE (argtype), fn);
/* [class.mfct.nonstatic]: If a nonstatic member function of a class
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 1a76816..500ddaa 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -2493,27 +2493,27 @@ finish_struct_anon (tree t)
if (TREE_CODE (elt) != FIELD_DECL)
{
if (is_union)
- pedwarn ("%q+#D invalid; an anonymous union can "
- "only have non-static data members", elt);
+ permerror ("%q+#D invalid; an anonymous union can "
+ "only have non-static data members", elt);
else
- pedwarn ("%q+#D invalid; an anonymous struct can "
- "only have non-static data members", elt);
+ permerror ("%q+#D invalid; an anonymous struct can "
+ "only have non-static data members", elt);
continue;
}
if (TREE_PRIVATE (elt))
{
if (is_union)
- pedwarn ("private member %q+#D in anonymous union", elt);
+ permerror ("private member %q+#D in anonymous union", elt);
else
- pedwarn ("private member %q+#D in anonymous struct", elt);
+ permerror ("private member %q+#D in anonymous struct", elt);
}
else if (TREE_PROTECTED (elt))
{
if (is_union)
- pedwarn ("protected member %q+#D in anonymous union", elt);
+ permerror ("protected member %q+#D in anonymous union", elt);
else
- pedwarn ("protected member %q+#D in anonymous struct", elt);
+ permerror ("protected member %q+#D in anonymous struct", elt);
}
TREE_PRIVATE (elt) = TREE_PRIVATE (field);
@@ -3044,7 +3044,7 @@ check_field_decls (tree t, tree *access_decls,
user-defined constructor. */
if (constructor_name_p (DECL_NAME (x), t)
&& TYPE_HAS_USER_CONSTRUCTOR (t))
- pedwarn ("field %q+#D with same name as class", x);
+ permerror ("field %q+#D with same name as class", x);
/* We set DECL_C_BIT_FIELD in grokbitfield.
If the type and width are valid, we'll also set DECL_BIT_FIELD. */
@@ -6072,10 +6072,10 @@ resolve_address_of_overloaded_function (tree target_type,
if (!(flags & tf_error))
return error_mark_node;
- pedwarn ("assuming pointer to member %qD", fn);
+ permerror ("assuming pointer to member %qD", fn);
if (!explained)
{
- pedwarn ("(a pointer to member can only be formed with %<&%E%>)", fn);
+ inform ("(a pointer to member can only be formed with %<&%E%>)", fn);
explained = 1;
}
}
@@ -6435,8 +6435,8 @@ note_name_declared_in_class (tree name, tree decl)
A name N used in a class S shall refer to the same declaration
in its context and when re-evaluated in the completed scope of
S. */
- pedwarn ("declaration of %q#D", decl);
- pedwarn ("changes meaning of %qD from %q+#D",
+ permerror ("declaration of %q#D", decl);
+ permerror ("changes meaning of %qD from %q+#D",
DECL_NAME (OVL_CURRENT (decl)), (tree) n->value);
}
}
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index a75036f..ee5759d 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -379,7 +379,7 @@ warn_ref_binding (tree reftype, tree intype, tree decl)
msg = "conversion to non-const reference type %q#T from"
" rvalue of type %qT";
- pedwarn (msg, reftype, intype);
+ permerror (msg, reftype, intype);
}
}
@@ -449,8 +449,8 @@ convert_to_reference (tree reftype, tree expr, int convtype,
if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr))
- pedwarn ("conversion from %qT to %qT discards qualifiers",
- ttr, reftype);
+ permerror ("conversion from %qT to %qT discards qualifiers",
+ ttr, reftype);
}
return build_up_reference (reftype, expr, flags, decl);
@@ -646,9 +646,9 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
|| TREE_CODE (intype) == POINTER_TYPE))
{
if (flags & LOOKUP_COMPLAIN)
- pedwarn ("conversion from %q#T to %q#T", intype, type);
+ permerror ("conversion from %q#T to %q#T", intype, type);
- if (flag_pedantic_errors)
+ if (!flag_permissive)
return error_mark_node;
}
if (IS_AGGR_TYPE (intype))
@@ -892,8 +892,8 @@ convert_to_void (tree expr, const char *implicit)
{
/* [over.over] enumerates the places where we can take the address
of an overloaded function, and this is not one of them. */
- pedwarn ("%s cannot resolve address of overloaded function",
- implicit ? implicit : "void cast");
+ error ("%s cannot resolve address of overloaded function",
+ implicit ? implicit : "void cast");
expr = void_zero_node;
}
else if (implicit && probe == expr && is_overloaded_fn (probe))
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 99078e4..32a0db8 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7028,12 +7028,7 @@ compute_array_index_type (tree name, tree size)
{
/* Check to see if the array bound overflowed. Make that an
error, no matter how generous we're being. */
- int old_flag_pedantic_errors = flag_pedantic_errors;
- int old_pedantic = pedantic;
- pedantic = flag_pedantic_errors = 1;
- constant_expression_warning (size);
- pedantic = old_pedantic;
- flag_pedantic_errors = old_flag_pedantic_errors;
+ constant_expression_error (size);
/* An array must have a positive number of elements. */
if (INT_CST_LT (size, integer_zero_node))
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 0893f80..97a1785 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2651,7 +2651,7 @@ cp_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level,
dlevel = DK_WARNING;
break;
case CPP_DL_PEDWARN:
- dlevel = pedantic_error_kind ();
+ dlevel = pedantic_warning_kind ();
break;
case CPP_DL_ERROR:
dlevel = DK_ERROR;
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 0b2a372..06c0bc2 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -647,16 +647,16 @@ unqualified_fn_lookup_error (tree name)
Note that we have the exact wording of the following message in
the manual (trouble.texi, node "Name lookup"), so they need to
be kept in synch. */
- pedwarn ("there are no arguments to %qD that depend on a template "
- "parameter, so a declaration of %qD must be available",
- name, name);
+ permerror ("there are no arguments to %qD that depend on a template "
+ "parameter, so a declaration of %qD must be available",
+ name, name);
if (!flag_permissive)
{
static bool hint;
if (!hint)
{
- error ("(if you use %<-fpermissive%>, G++ will accept your "
+ inform ("(if you use %<-fpermissive%>, G++ will accept your "
"code, but allowing the use of an undeclared name is "
"deprecated)");
hint = true;
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 817a062..3ffac73 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9775,7 +9775,7 @@ cp_parser_template_id (cp_parser *parser,
}
/* Otherwise, emit an error about the invalid digraph, but continue
parsing because we got our argument list. */
- pedwarn ("%<<::%> cannot begin a template-argument list");
+ permerror ("%<<::%> cannot begin a template-argument list");
inform ("%<<:%> is an alternate spelling for %<[%>. Insert whitespace "
"between %<<%> and %<::%>");
if (!flag_permissive)