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: [C++-11] User defined literals


On 10/12/2011 01:05 AM, Ed Smith-Rowland wrote:
cp_parser_operator(function_id) is simply run twice in
cp_parser_unqualified_id.
Once inside cp_parser_template_id called at parser.c:4515.
Once directly inside cp_parser_unqualified_id at parser.c:4525.

Ah. You could try replacing the operator "" X tokens with a single CPP_LITERAL_OPERATOR token, like we do for CPP_NESTED_NAME_SPECIFIER and CPP_TEMPLATE_ID.


cp_parser_template_id never succeeds with literal operator templates. I
find that curious. But I haven't looked real hard and the things do get
parsed somehow.

I'd only expect it to succeed if you actually wrote, e.g.,


operator""_c<'a','b','c'>();

Jason


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