vsapsai added a comment. In https://reviews.llvm.org/D47687#1136351, @Higuoxing wrote:
> Sorry, It seems a little bit difficult for me to add a proper fix-it hint for > expressions in macros, because I cannot find the exact position of the last > char of the token on right hand side of operator. Any suggestion? Can you please clarify what exactly isn't working? `SuggestParentheses` is doing most of what you need but in this case it doesn't work because of macro locations: static void SuggestParentheses(Sema &Self, SourceLocation Loc, const PartialDiagnostic &Note, SourceRange ParenRange) { SourceLocation EndLoc = Self.getLocForEndOfToken(ParenRange.getEnd()); if (ParenRange.getBegin().isFileID() && ParenRange.getEnd().isFileID() && EndLoc.isValid()) { Self.Diag(Loc, Note) << FixItHint::CreateInsertion(ParenRange.getBegin(), "(") << FixItHint::CreateInsertion(EndLoc, ")"); } else { // We can't display the parentheses, so just show the bare note. Self.Diag(Loc, Note) << ParenRange; } } Hope this gives you an idea how you can try to make fix-its work. https://reviews.llvm.org/D47687 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits