[PATCH] D61722: [AST] Add RecoveryExpr; produce it on overload resolution failure and missing member.

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 16:46:16 PDT 2019


erik.pilkington added a reviewer: erik.pilkington.
erik.pilkington added inline comments.
Herald added a subscriber: dexonsmith.


================
Comment at: include/clang/AST/BuiltinTypes.def:265
+// a template.
+BUILTIN_TYPE(Recovery, RecoveryTy)
+
----------------
Why are you creating a new type as opposed to just using DependentTy (sorta like TypoExpr does)? It seems like if you want to recycle all the dependence-propagating code in Sema, then you need to fall back to DependentTy anyways, i.e. `1 + <recovery-expr>` will have dependent type with this patch, right?




================
Comment at: lib/Sema/SemaOverload.cpp:12248
+  SubExprs.append(Args.begin(), Args.end());
+  if (auto RE = RecoveryExpr::Create(
+             SemaRef.Context, chooseRecoveryType(*CandidateSet, Best),
----------------
Have you also considered handling this like delayed typos, where we try to TreeTransform into different possible recoveries later, in order to find out what the best fix is? You might be able to make a better guess as to what the right function to pick (or how to recover in general) is if you can see how the recovery would be used, but deciding here means you have a lot less information.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61722





More information about the cfe-commits mailing list