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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The tentative parse when trying to parse it as a function declaration is
aborted with the cp_parser_error below in cp_parser_direct_declarator:
                else if (unqualified_name
                         && (qualifying_scope
                             || (!identifier_p (unqualified_name))))
                  {
                    cp_parser_error (parser, "expected unqualified-id");
                    unqualified_name = error_mark_node;
                  }
So, shall that be replaced with an unconditional error, so that it doesn't
abort the tentative parsing, or shall it remember this case some way and let
only the semantic analysis in decl.c error on it later?

Another testcase (accepts-invalid):
namespace a {
  enum c { d };
  struct e {
    e(c);
  };
}; // namespace a
a::e f(a::e(a::d));

Reply via email to