[cfe-dev] My first patch to clang

John McCall rjmccall at apple.com
Sun Dec 6 15:40:22 PST 2009


On Dec 6, 2009, at 4:55 AM, Nicola Gigante wrote:
> Il giorno 05/dic/2009, alle ore 20.23, John McCall ha scritto:
>> 
>> Exactly.  You should change the input to look exactly like it would look if the user had typed '->' instead.  That's why you want your check to run before LookupMemberExpr tries to adjust the base type to the pointee type and so on.
> 4 diagnostics generated.

This seems like good output.

> I think it's the right output. The only thing I can't understand is: All the four errors use BaseExpr->getSourceRange() to get the range of the base expressions, but in the first and the third errors (the two added by my patch), the range is wrong because also includes the arrow (or the dot). Is it my fault?

The replacement fixit causes the original text to be underlined.  Don't worry about it.

> <member_pointer_suggestion.patch>

The functionality looks good!  Please use tabs instead of spaces, and don't put spaces inside 'if' conditions like this:

+		else if ( BaseType->isRecordType() ) {

Do you need someone to commit this for you?

John.



More information about the cfe-dev mailing list