http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49834

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
            Summary|type deduction in for-each  |[C++0x] type deduction in
                   |loop in template function   |for-each loop in template
                   |                            |function

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-02 
14:53:52 UTC ---
The failure can be fixed by adding the 'template' keyword:

    for (const auto &i: p)// ERROR
        i.second.template get_value<int>();
                         ^^^^^^^^^

Jason, is G++ correct to require that there?

If so, should it also require it on the previous loop?

    for (const C::value_type &i: p)// OK
        i.second.template get_value<int>();
                         ^^^^^^^^^

i.e. is the real bug that we accept the first loop, not that we reject the
second?

Reply via email to