Tiny C++ cleanups.
authorJason Merrill <jason@redhat.com>
Tue, 19 Apr 2016 17:49:34 +0000 (13:49 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 19 Apr 2016 17:49:34 +0000 (13:49 -0400)
* pt.c (tsubst_expr): Remove shadowing declaration.
(tsubst_pack_expansion): Add assert.
* semantics.c (add_decl_expr): Use DECL_SOURCE_LOCATION.

From-SVN: r235213

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/cp/semantics.c

index 056e91740c0a5a1e4c627888f2e19663693fe0ac..344cad023f77ea39d88125eab3a7cd11476cb5fd 100644 (file)
@@ -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.
index a6d56d147bb424f0fcc41c969ef7661160964e69..f9a9d990a46ce92ba311324aabf3410b686aace0 100644 (file)
@@ -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,
index 0487adf6018db461efb9cb246cce745f1e2f1dd3..56864b4395c5e6ff0d039d7774ed31516c6f6c08 100644 (file)
@@ -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);