[PATCH] D56723: [CodeComplete] Propagate preferred types through parser in more cases

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 28 14:38:17 PST 2019


rsmith added inline comments.


================
Comment at: clang/include/clang/Sema/Sema.h:319-346
+class PreferredTypeBuilder::RestoreRAII {
+public:
+  RestoreRAII(RestoreRAII const &) = delete;
+  RestoreRAII &operator=(RestoreRAII const &) = delete;
+
+  explicit RestoreRAII(PreferredTypeBuilder &Builder)
+      : OldType(Builder.Type), OldLoc(Builder.ExpectedLoc), Builder(&Builder) {}
----------------
Now we store a location along with the expected type, I don't think we need an RAII object any more. (We would need to save/restore in tentative parsing, if we ever called any of the parsing functions that set a preferred type, but tentative parsing shouldn't be doing that.)


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

https://reviews.llvm.org/D56723





More information about the cfe-commits mailing list