Richard Smith: Is there a reasonable way to get the ')' of an "if ()" expression in the AST? Is it just a matter of going down and playing games with source locations/lexing to get the token after the end location of the condition expression?
On Thu, Jan 28, 2016 at 4:57 PM, Wolfgang Pieb via cfe-commits < cfe-commits@lists.llvm.org> wrote: > wolfgangp added a comment. > > > > > Clang (with patch) > > > 3, 5, 4, 5, 7 > > > 9, 11, 10, 11, 14 > > > > > > So that's somewhat problematic - we shouldn't visit 11 at all. (but we > are today, as is GCC... so maybe NBD?) > > > Well, if op&& is overloaded, wouldn't we lose the short-circuit property? > If so it makes sense to visit 11. > oh, right... thanks for pointing that out. Sorry I missed it. > > > I think using the end of the condition is problematic/confusing. I'm not > sure why this doesn't show up in the primitive value version, but it seems > like it should (& we should end up stepping to the end of the condition > (which would be the close paren of the function call, not the close paren > of the 'if ()')) > > > There is short-circuit in the primitive value version, so we wouldn't stop > there. > > > Perhaps we should use the close paren of the 'if ()' but tehre's no > source location for that readily available - I guess the way to get there > is to navigate to the next token from the end of the condition > expression... ? > > > I agree, The close paren of the if() would be better. > > > http://reviews.llvm.org/D8822 > > > > _______________________________________________ > cfe-commits mailing list > cfe-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits >
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits