]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* parser.c (cp_parser_perform_range_for_lookup): Decay the array.
authorJason Merrill <jason@redhat.com>
Fri, 22 Apr 2016 16:16:21 +0000 (12:16 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 22 Apr 2016 16:16:21 +0000 (12:16 -0400)
From-SVN: r235370

gcc/cp/ChangeLog
gcc/cp/parser.c

index ecfad0fe5fec4756cfc70b90cbf83aac56d1bdb1..3a3373e3806a51975fbe3a166e066ea2fb15b957 100644 (file)
@@ -1,3 +1,7 @@
+2016-04-22  Jason Merrill  <jason@redhat.com>
+
+       * parser.c (cp_parser_perform_range_for_lookup): Decay the array.
+
 2016-04-21  Patrick Palka  <ppalka@gcc.gnu.org>
 
        * name-lookup.c (free_saved_scope): New free list of saved_scope
index feb8de76bc3a6bdfa688792547082f73e37d3b5b..500a9b39a26e6ae8d55b45785742b8099c9e36aa 100644 (file)
@@ -11413,12 +11413,12 @@ cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
   if (TREE_CODE (TREE_TYPE (range)) == ARRAY_TYPE)
     {
       /* If RANGE is an array, we will use pointer arithmetic.  */
-      *begin = range;
+      *begin = decay_conversion (range, tf_warning_or_error);
       *end = build_binary_op (input_location, PLUS_EXPR,
                              range,
                              array_type_nelts_top (TREE_TYPE (range)),
                              0);
-      return build_pointer_type (TREE_TYPE (TREE_TYPE (range)));
+      return TREE_TYPE (*begin);
     }
   else
     {