[PATCH] D81008: [AST] Record SourceLocation for TypoExpr.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 00:30:50 PDT 2020


hokein added inline comments.


================
Comment at: clang/include/clang/AST/Expr.h:6158
 public:
-  TypoExpr(QualType T) : Expr(TypoExprClass, T, VK_LValue, OK_Ordinary) {
+  TypoExpr(QualType T, SourceLocation Start, SourceLocation End)
+      : Expr(TypoExprClass, T, VK_LValue, OK_Ordinary), Start(Start), End(End) {
----------------
sammccall wrote:
> can we have Start != End in practice?
> 
> Looking at DeclarationNameInfo::getEndLocPrivate(), it seems like this only happens in operators, literal-operators, conversions, constructors/destructors.
> 
> If these don't actually support typo correction maybe we should just use one location?
ah, yes, I missed this.

typo correction only supports identifiers, so Start and End are always the same.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81008/new/

https://reviews.llvm.org/D81008





More information about the cfe-commits mailing list