ilya-biryukov marked 2 inline comments as done. ilya-biryukov 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) {} ---------------- rsmith wrote: > 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.) No RAII objects anymore. By keeping them I intended to simplify the requirements on the callers that wouldn't need to worry about restoring the expected type after parsing parts of an expression. In practice, it's not a big burden and the resulting code looks even more concise. There are surely some cases we're missing, but it's fine, we'll track them down later and missing expected type in some cases is totally ok. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56723/new/ https://reviews.llvm.org/D56723 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits