Disable auto_is_implicit_function_template_parm_p while parsing attributes
commit0cf97c34f40466fde26673d2ff8b799a990c8f28
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Mar 2018 01:18:48 +0000 (23 01:18 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 23 Mar 2018 01:18:48 +0000 (23 01:18 +0000)
treefff8b26767172444ca89fa6022588042e5fe90f4
parent8f08c87321376ecb3c82fbf6c9f9ed29a7a17705
Disable auto_is_implicit_function_template_parm_p while parsing attributes

We don't want functions to become implicit templates just because of
random uses of auto in unexpected places.  Disabling the special
handling of auto while parsing attributes, for example, makes for
more sensible errors.

for  gcc/cp/ChangeLog

PR c++/84610
PR c++/84642
PR c++/84942
* cp-tree.h (temp_override): New template class, generalizing
a cleanup that was only used...
* parser.c (cp_parser_parameter_declaration_clause):
... here for auto_is_implicit_function_template_parm_p.
(cp_parser_gnu_attributes_opt): Use it here as well.
(cp_parser_std_attribute): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258790 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/parser.c