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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 2 09:52:38 PDT 2020


sammccall 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) {
----------------
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?


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