https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78704

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-12-07
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org
   Target Milestone|---                         |7.0
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Doesn't seem to be a regression, since r185596 when -std=c++1y option has been
added it has been rejected with:
error: ‘operator->’ function uses ‘auto’ type specifier without trailing return
type
error: base operand of ‘->’ has non-pointer type ‘const Foo<int>’
(like with -std=c++11) and starting with r185768 when return type C++14 auto
deduction has been implemented it is rejected with just
error: result of ‘operator->()’ yields non-pointer result

clang++ accepts this.  Either something should have deduced the return type of
the operator-> earlier, or build_x_arrow should assume that if
(processing_template_decl && type_uses_auto (TREE_TYPE (last_rval))) or
something similar, then the return type could be a pointer and handle it as if
expr has been type dependent from the beginning.  Jason?

Reply via email to