summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-19 17:49:34 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-19 17:49:34 +0000
commit9b695ed1495b645b43e1ebd76e76261b67719880 (patch)
treeab9a7156a485e7735e64d5c75a1b93ebad68b666
parent901cf1e23d8ebd0ec65e4091153717b0699bc78c (diff)
downloadgcc-9b695ed1495b645b43e1ebd76e76261b67719880.tar.gz
Tiny C++ cleanups.
* pt.c (tsubst_expr): Remove shadowing declaration. (tsubst_pack_expansion): Add assert. * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235213 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/semantics.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 056e91740c0..344cad023f7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2016-04-19 Jason Merrill <jason@redhat.com>
+ * pt.c (tsubst_expr): Remove shadowing declaration.
+ (tsubst_pack_expansion): Add assert.
+
+ * semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.
+
PR c++/70522
* name-lookup.c (qualified_lookup_using_namespace): Look through
hidden names.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index a6d56d147bb..f9a9d990a46 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10961,6 +10961,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain,
/* We can't substitute for this parameter pack. We use a flag as
well as the missing_level counter because function parameter
packs don't have a level. */
+ gcc_assert (processing_template_decl);
unsubstituted_packs = true;
}
}
@@ -15135,7 +15136,6 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
{
tree scope = USING_DECL_SCOPE (decl);
tree name = DECL_NAME (decl);
- tree decl;
scope = tsubst (scope, args, complain, in_decl);
decl = lookup_qualified_name (scope, name,
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 0487adf6018..56864b4395c 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -428,7 +428,7 @@ maybe_cleanup_point_expr_void (tree expr)
void
add_decl_expr (tree decl)
{
- tree r = build_stmt (input_location, DECL_EXPR, decl);
+ tree r = build_stmt (DECL_SOURCE_LOCATION (decl), DECL_EXPR, decl);
if (DECL_INITIAL (decl)
|| (DECL_SIZE (decl) && TREE_SIDE_EFFECTS (DECL_SIZE (decl))))
r = maybe_cleanup_point_expr_void (r);