diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-22 16:16:21 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-22 16:16:21 +0000 |
commit | 5352530896605643bb65227f180cf27e924e821e (patch) | |
tree | 357da5d82dcc3c51eed36f59c7c9eed17170d8d4 | |
parent | c052a8d50027bdbf0e25570eb77bd75aaec399e1 (diff) | |
download | gcc-5352530896605643bb65227f180cf27e924e821e.tar.gz |
* parser.c (cp_parser_perform_range_for_lookup): Decay the array.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235370 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ecfad0fe5fe..3a3373e3806 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index feb8de76bc3..500a9b39a26 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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 { |