summaryrefslogtreecommitdiffstats
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 500c81f79fc..40a9a8cb7cc 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -376,7 +376,8 @@ pop_label (tree label, tree old_value)
location_t location;
error ("label %q+D used but not defined", label);
- location = input_location; /* FIXME want (input_filename, (line)0) */
+ location = input_location;
+ /* FIXME want (LOCATION_FILE (input_location), (line)0) */
/* Avoid crashing later. */
define_label (location, DECL_NAME (label));
}
@@ -3092,7 +3093,7 @@ pop_switch (void)
location_t switch_location;
/* Emit warnings as needed. */
- switch_location = EXPR_LOC_OR_HERE (cs->switch_stmt);
+ switch_location = EXPR_LOC_OR_LOC (cs->switch_stmt, input_location);
if (!processing_template_decl)
c_do_switch_warnings (cs->cases, switch_location,
SWITCH_STMT_TYPE (cs->switch_stmt),
@@ -4241,7 +4242,7 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
error ("multiple types in one declaration");
else if (declspecs->redefined_builtin_type)
{
- if (!in_system_header)
+ if (!in_system_header_at (input_location))
permerror (declspecs->locations[ds_redefined_builtin_type_spec],
"redeclaration of C++ built-in type %qT",
declspecs->redefined_builtin_type);
@@ -4292,7 +4293,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs,
/* Anonymous unions are objects, so they can have specifiers. */;
SET_ANON_AGGR_TYPE_P (declared_type);
- if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header)
+ if (TREE_CODE (declared_type) != UNION_TYPE
+ && !in_system_header_at (input_location))
pedwarn (input_location, OPT_Wpedantic, "ISO C++ prohibits anonymous structs");
}
@@ -5846,7 +5848,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
/* We try to defer namespace-scope static constants so that they are
not emitted into the object file unnecessarily. */
- filename = input_filename;
+ filename = LOCATION_FILE (input_location);
if (!DECL_VIRTUAL_P (decl)
&& TREE_READONLY (decl)
&& DECL_INITIAL (decl) != NULL_TREE
@@ -8309,7 +8311,7 @@ compute_array_index_type (tree name, tree size, tsubst_flags_t complain)
indicated by the state of complain), so that
another substitution can be found. */
return error_mark_node;
- else if (in_system_header)
+ else if (in_system_header_at (input_location))
/* Allow them in system headers because glibc uses them. */;
else if (name)
pedwarn (input_location, OPT_Wpedantic, "ISO C++ forbids zero-size array %qD", name);
@@ -9096,7 +9098,7 @@ grokdeclarator (const cp_declarator *declarator,
if (type_was_error_mark_node)
/* We've already issued an error, don't complain more. */;
- else if (in_system_header || flag_ms_extensions)
+ else if (in_system_header_at (input_location) || flag_ms_extensions)
/* Allow it, sigh. */;
else if (! is_main)
permerror (input_location, "ISO C++ forbids declaration of %qs with no type", name);
@@ -9119,7 +9121,7 @@ grokdeclarator (const cp_declarator *declarator,
error ("%<__int128%> is not supported by this target");
explicit_int128 = false;
}
- else if (pedantic && ! in_system_header)
+ else if (pedantic && ! in_system_header_at (input_location))
pedwarn (input_location, OPT_Wpedantic,
"ISO C++ does not support %<__int128%> for %qs", name);
}
OpenPOWER on IntegriCloud