]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* parser.c (cp_parser_perform_range_for_lookup): Decay the array.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Apr 2016 16:16:21 +0000 (16:16 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 22 Apr 2016 16:16:21 +0000 (16:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235370 138bc75d-0d04-0410-961f-82ee72b054a4

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
     {