Statement End Location

Hi,
   I want to find the end location of a statement. Unfortunately, clang
gives the end location at an undesired place. e.g.

return a; // I want the end to be after ";"

return a; // while clang gives the end after "return"

a = a + 2; // I need end at ";", but clang gives end at "a=a"

    This is similar for other statements. Is there any reasons for not
including the final portion in the Statement. If yes, how can I get the end
location at ";" rather than before. Thxn for your help.

Regards,
Adil

That sounds like bugs in the AST node creation. The correct fix is probably in the parser, where the end locations for statements must be passed to Sema.

Sebastian