This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR preprocessor/84517 allow double-underscore macros after string literals
- From: Tim Song <t dot canens dot cpp at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 Feb 2018 11:49:40 -0500
- Subject: Re: [PATCH] PR preprocessor/84517 allow double-underscore macros after string literals
- Authentication-results: sourceware.org; auth=none
- References: <CAH6eHdTfKxbucGxh7FGjRcWeNKhAqfQQO+k0pC7CjAaDKfy8Vw@mail.gmail.com>
On Tue, Feb 27, 2018 at 9:41 AM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> Since the fix for PR c++/80955 any suffix on a string literal that
> begins with an underscore is assumed to be a user-defined literal
> suffix, not a macro. This assumption is invalid for a suffix beginning
> with two underscores, because such names are reserved and can't be used
> for UDLs anyway.
[lex.name]/3 reserves all identifiers containing double underscore,
but the spaceless one-token form does not actually use such an
identifier.
See the (equally reserved) _Bq example in [over.literal]/8:
double operator""_Bq(long double); // OK: does not
use the reserved identifier _Bq ([lex.name])
double operator"" _Bq(long double); // uses the
reserved identifier _Bq ([lex.name])