diff options
author | Jason Merrill <jason@redhat.com> | 2011-08-05 15:12:16 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-08-05 15:12:16 -0400 |
commit | fcbc2bedbfb3a584bd98a7792d7d088db8e8c6fd (patch) | |
tree | f4ee67a30913197f88bcf1082f3b80d2408d9781 /gcc/cp/parser.c | |
parent | a034826198b7711835f21307c6976926442f5b97 (diff) | |
download | gcc-fcbc2bedbfb3a584bd98a7792d7d088db8e8c6fd.zip gcc-fcbc2bedbfb3a584bd98a7792d7d088db8e8c6fd.tar.gz gcc-fcbc2bedbfb3a584bd98a7792d7d088db8e8c6fd.tar.bz2 |
re PR c++/49983 ([C++0x] Template types fail in range-based for.)
PR c++/49983
* parser.c (cp_parser_range_for): Only do auto deduction in
template if the range is non-dependent.
From-SVN: r177478
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 9b3e56d..84b8c60 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -8679,7 +8679,8 @@ cp_parser_range_for (cp_parser *parser, tree scope, tree init, tree range_decl) { stmt = begin_range_for_stmt (scope, init); finish_range_for_decl (stmt, range_decl, range_expr); - do_range_for_auto_deduction (range_decl, range_expr); + if (!type_dependent_expression_p (range_expr)) + do_range_for_auto_deduction (range_decl, range_expr); } else { |