Doug Gregor wrote:
> On Fri, Nov 7, 2008 at 5:53 PM, Sebastian Redl
> <[EMAIL PROTECTED]> wrote:
>   
>   
>>> +
>>> +#ifndef OVERLOADED_OPERATOR
>>> +#  define OVERLOADED_OPERATOR(Name,Spelling,Token)
>>> +#endif
>>>
>>>       
>> Wouldn't it make more sense to put an #error directive here? Surely
>> including a .def file without defining those macros cannot be intentional.
>>     
>
> One might want to pull out just the multi-token operators, so I made
> that option easy.
>   
OK, makes sense.
>   
>>> +IdentifierInfo *Parser::MaybeParseOperatorFunctionId() {
>>> +  if (Tok.isNot(tok::kw_operator))
>>> +    return 0;
>>> +
>>> +  OverloadedOperatorKind Op = OO_None;
>>> +  switch (NextToken().getKind()) {
>>>
>>>       
>> Hmm ... I know very little about how Clang's parser works, but wouldn't it
>> be easier to just consume the operator keyword no matter what? What's the
>> use case of leaving it in there? (Obviously, the part that parses a
>> conversion operator would have to be adapted.)
>>     
>
> If the token after the 'operator' does not start an
> operator-function-id, we don't parse the 'operator'. Instead, we end
> up parsing a conversion-function-id, which consumes the 'operator'.
>   
Well, the conversion-function-id could simply not consume the 'operator'.

Sebastian

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to