On 19.02.2016 16:22, Jakub Jelinek wrote:
> On Fri, Feb 19, 2016 at 03:09:25PM +0000, Bernd Edlinger wrote:
>> Hmm... wait a moment.
>> How about that?
>
> Guess it is mostly reasonable (still, this is C++ FE, so I'd prefer
> Jason to ack it), except for:
>
>> +#define libc_name_p Perfect_Hash::libc_name_p
>

Yeee. Right.

> this.  Doesn't that cause
> Perfect_Hash::libc_name_p (register const char *str, register unsigned int 
> len)
> to expand as
> Perfect_Hash:: Perfect_Hash::libc_name_p (register const char *str, register 
> unsigned int len)
> ?
>
> So, I think better might be something like:
>
> --- gcc/cp/Make-lang.in.jj    2016-01-04 14:55:57.000000000 +0100
> +++ gcc/cp/Make-lang.in       2016-02-19 16:21:11.538734055 +0100
> @@ -112,7 +112,7 @@ else
>   # deleting the $(srcdir)/cp/cfns.h file.
>   $(srcdir)/cp/cfns.h:
>   endif
> -     gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
> +     gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
>               $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
>
>   #
> --- gcc/cp/except.c.jj        2016-01-04 14:55:57.000000000 +0100
> +++ gcc/cp/except.c   2016-02-19 16:20:37.134205968 +0100
> @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
>        unless the system headers are playing rename tricks, and if
>        they are, we don't want to be confused by them.  */
>     id = DECL_NAME (fn);
> -  return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
> +  return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
> +                                IDENTIFIER_LENGTH (id));
>   }
>
>   /* Returns nonzero if an exception of type FROM will be caught by a
> --- gcc/cp/cfns.gperf.jj      2016-02-19 14:41:14.000000000 +0100
> +++ gcc/cp/cfns.gperf 2016-02-19 16:19:34.841060418 +0100
> @@ -1,3 +1,5 @@
> +%language=C++
> +%define class-name libc_name
>   %{

I like this idea with class-name.
Will post an updated patch in a minute.


Thanks
Bernd.

Reply via email to