decl.c: Replace %H by an explicit location.

2009-07-06  Manuel López-Ibáñez  <manu@gcc.gnu.org>

cp/
	* decl.c: Replace %H by an explicit location. Update all calls.
	* except.c: Likewise.
	* semantics.c: Likewise.
	* parser.c: Likewise.

From-SVN: r149277
parent c4efba1c
2009-07-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
* decl.c: Replace %H by an explicit location. Update all calls.
* except.c: Likewise.
* semantics.c: Likewise.
* parser.c: Likewise.
2009-07-06 Simon Martin <simartin@users.sourceforge.net> 2009-07-06 Simon Martin <simartin@users.sourceforge.net>
PR c++/40557 PR c++/40557
......
...@@ -2490,7 +2490,7 @@ identify_goto (tree decl, const location_t *locus) ...@@ -2490,7 +2490,7 @@ identify_goto (tree decl, const location_t *locus)
else else
permerror (input_location, "jump to case label"); permerror (input_location, "jump to case label");
if (locus) if (locus)
permerror (input_location, "%H from here", locus); permerror (*locus, " from here");
} }
/* Check that a single previously seen jump to a newly defined label /* Check that a single previously seen jump to a newly defined label
......
...@@ -998,10 +998,11 @@ check_handlers_1 (tree master, tree_stmt_iterator i) ...@@ -998,10 +998,11 @@ check_handlers_1 (tree master, tree_stmt_iterator i)
tree handler = tsi_stmt (i); tree handler = tsi_stmt (i);
if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler))) if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
{ {
warning (0, "%Hexception of type %qT will be caught", warning_at (EXPR_LOCATION (handler), 0,
EXPR_LOCUS (handler), TREE_TYPE (handler)); "exception of type %qT will be caught",
warning (0, "%H by earlier handler for %qT", TREE_TYPE (handler));
EXPR_LOCUS (master), type); warning_at (EXPR_LOCATION (master), 0,
" by earlier handler for %qT", type);
break; break;
} }
} }
...@@ -1030,8 +1031,8 @@ check_handlers (tree handlers) ...@@ -1030,8 +1031,8 @@ check_handlers (tree handlers)
if (tsi_end_p (i)) if (tsi_end_p (i))
break; break;
if (TREE_TYPE (handler) == NULL_TREE) if (TREE_TYPE (handler) == NULL_TREE)
permerror (input_location, "%H%<...%> handler must be the last handler for" permerror (EXPR_LOCATION (handler), "%<...%>"
" its try block", EXPR_LOCUS (handler)); " handler must be the last handler for its try block");
else else
check_handlers_1 (handler, i); check_handlers_1 (handler, i);
} }
......
...@@ -2563,20 +2563,21 @@ qualified_name_lookup_error (tree scope, tree name, ...@@ -2563,20 +2563,21 @@ qualified_name_lookup_error (tree scope, tree name,
else if (TYPE_P (scope)) else if (TYPE_P (scope))
{ {
if (!COMPLETE_TYPE_P (scope)) if (!COMPLETE_TYPE_P (scope))
error ("%Hincomplete type %qT used in nested name specifier", error_at (location, "incomplete type %qT used in nested name specifier",
&location, scope); scope);
else if (TREE_CODE (decl) == TREE_LIST) else if (TREE_CODE (decl) == TREE_LIST)
{ {
error ("%Hreference to %<%T::%D%> is ambiguous", &location, scope, name); error_at (location, "reference to %<%T::%D%> is ambiguous",
scope, name);
print_candidates (decl); print_candidates (decl);
} }
else else
error ("%H%qD is not a member of %qT", &location, name, scope); error_at (location, "%qD is not a member of %qT", name, scope);
} }
else if (scope != global_namespace) else if (scope != global_namespace)
error ("%H%qD is not a member of %qD", &location, name, scope); error_at (location, "%qD is not a member of %qD", name, scope);
else else
error ("%H%<::%D%> has not been declared", &location, name); error_at (location, "%<::%D%> has not been declared", name);
} }
/* If FNS is a member function, a set of member functions, or a /* If FNS is a member function, a set of member functions, or a
...@@ -3984,7 +3985,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, ...@@ -3984,7 +3985,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
} }
if (cond == error_mark_node) if (cond == error_mark_node)
{ {
error ("%Hinvalid controlling predicate", &elocus); error_at (elocus, "invalid controlling predicate");
return true; return true;
} }
diff = build_x_binary_op (MINUS_EXPR, TREE_OPERAND (cond, 1), diff = build_x_binary_op (MINUS_EXPR, TREE_OPERAND (cond, 1),
...@@ -3994,8 +3995,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, ...@@ -3994,8 +3995,8 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
return true; return true;
if (TREE_CODE (TREE_TYPE (diff)) != INTEGER_TYPE) if (TREE_CODE (TREE_TYPE (diff)) != INTEGER_TYPE)
{ {
error ("%Hdifference between %qE and %qD does not have integer type", error_at (elocus, "difference between %qE and %qD does not have integer type",
&elocus, TREE_OPERAND (cond, 1), iter); TREE_OPERAND (cond, 1), iter);
return true; return true;
} }
...@@ -4089,7 +4090,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, ...@@ -4089,7 +4090,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv,
if (incr == error_mark_node) if (incr == error_mark_node)
{ {
error ("%Hinvalid increment expression", &elocus); error_at (elocus, "invalid increment expression");
return true; return true;
} }
...@@ -4216,8 +4217,8 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv, ...@@ -4216,8 +4217,8 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (decl == NULL) if (decl == NULL)
{ {
error ("%Hexpected iteration declaration or initialization", error_at (locus,
&locus); "expected iteration declaration or initialization");
return NULL; return NULL;
} }
} }
...@@ -4227,13 +4228,13 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv, ...@@ -4227,13 +4228,13 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (cond == NULL) if (cond == NULL)
{ {
error ("%Hmissing controlling predicate", &elocus); error_at (elocus, "missing controlling predicate");
return NULL; return NULL;
} }
if (incr == NULL) if (incr == NULL)
{ {
error ("%Hmissing increment expression", &elocus); error_at (elocus, "missing increment expression");
return NULL; return NULL;
} }
...@@ -4287,8 +4288,7 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv, ...@@ -4287,8 +4288,7 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (!DECL_P (decl)) if (!DECL_P (decl))
{ {
error ("%Hexpected iteration declaration or initialization", error_at (elocus, "expected iteration declaration or initialization");
&elocus);
return NULL; return NULL;
} }
...@@ -4313,7 +4313,7 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv, ...@@ -4313,7 +4313,7 @@ finish_omp_for (location_t locus, tree declv, tree initv, tree condv,
if (!INTEGRAL_TYPE_P (TREE_TYPE (decl)) if (!INTEGRAL_TYPE_P (TREE_TYPE (decl))
&& TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE) && TREE_CODE (TREE_TYPE (decl)) != POINTER_TYPE)
{ {
error ("%Hinvalid type for iteration variable %qE", &elocus, decl); error_at (elocus, "invalid type for iteration variable %qE", decl);
return NULL; return NULL;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment