summaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index b4f4404d1ed..c540c08e932 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -132,7 +132,8 @@ build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
tree
cp_build_parm_decl (tree name, tree type)
{
- tree parm = build_decl (PARM_DECL, name, type);
+ tree parm = build_decl (input_location,
+ PARM_DECL, name, type);
/* DECL_ARG_TYPE is only used by the back end and the back end never
sees templates. */
if (!processing_template_decl)
@@ -354,7 +355,7 @@ grok_array_decl (tree array_expr, tree index_exp)
if (array_expr == error_mark_node || index_exp == error_mark_node)
error ("ambiguous conversion for array subscript");
- expr = build_array_ref (array_expr, index_exp, input_location);
+ expr = build_array_ref (input_location, array_expr, index_exp);
}
if (processing_template_decl && expr != error_mark_node)
return build_min_non_dep (ARRAY_REF, expr, orig_array_expr, orig_index_exp,
@@ -1287,7 +1288,8 @@ build_anon_union_vars (tree type, tree object)
{
tree base;
- decl = build_decl (VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
+ decl = build_decl (input_location,
+ VAR_DECL, DECL_NAME (field), TREE_TYPE (field));
DECL_ANON_UNION_VAR_P (decl) = 1;
base = get_base_address (object);
@@ -2495,7 +2497,8 @@ get_guard (tree decl)
/* We use a type that is big enough to contain a mutex as well
as an integer counter. */
guard_type = targetm.cxx.guard_type ();
- guard = build_decl (VAR_DECL, sname, guard_type);
+ guard = build_decl (DECL_SOURCE_LOCATION (decl),
+ VAR_DECL, sname, guard_type);
/* The guard should have the same linkage as what it guards. */
TREE_PUBLIC (guard) = TREE_PUBLIC (decl);