This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING] C/C++ OpenACC routine directive, undeclared name error: try to help the user, once


On Tue, Jun 07, 2016 at 08:44:16AM +0200, Thomas Schwinge wrote:
> On Tue, 31 May 2016 17:49:49 +0200, I wrote:
> > OK for trunk, as follows?
> > 
> > commit 3289032bf7fd7e4a0cce37e7acd71e3330729d83
> > Author: Thomas Schwinge <thomas@codesourcery.com>
> > Date:   Tue May 31 17:46:26 2016 +0200
> > 
> >     C/C++ OpenACC routine directive, undeclared name error: try to help the user, once
> >     
> >     	gcc/c/
> >     	* c-parser.c (c_parser_oacc_routine): If running into an
> >     	undeclared name error, try to help the user, once.
> >     	gcc/cp/
> >     	* parser.c (cp_parser_oacc_routine): If running into an undeclared
> >     	name error, try to help the user, once.
> >     	gcc/testsuite/
> >     	* c-c++-common/goacc/routine-5.c: Update.

I don't like hinting user something that very often doesn't make any sense.

Wouldn't it be better to defer the inform call until we parse the next decl?

E.g. in the C++ FE arrange to have parser->oacc_routine set after the
directive, but with some new flag in there, and just throw it away silently
if it is not followed by function declaration, and emit the inform only if
the next declaration actually is the symbol mentioned in there?

In your testcase it is not followed by Baz declaration or definition, so
emitting the hint is just confusing.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]