erik.pilkington added a comment.

This looks correct, but I definitely agree that RAII would make this a lot 
nicer. Have you considered adding a `CancelableSaveAndRestore` or something to 
SaveAndRestore.h? It seems useful and generic enough to make it worthwhile. 
Otherwise, you could just write your own RAII object special-cased to handle 
this. A less intrusive way of doing this might be to wrap calls to this 
function with another that checks if the return value is TDK_Success, and if so 
restores these fields.



================
Comment at: lib/Sema/SemaTemplateDeduction.cpp:1376
       if (const ComplexType *ComplexArg = Arg->getAs<ComplexType>())
         return DeduceTemplateArgumentsByTypeMatch(S, TemplateParams,
                                     cast<ComplexType>(Param)->getElementType(),
----------------
What if this return TDK_Success?


https://reviews.llvm.org/D40284



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D40284: [... Jacob Bandes-Storch via Phabricator via cfe-commits
    • [PATCH] D402... Erik Pilkington via Phabricator via cfe-commits
    • [PATCH] D402... Jacob Bandes-Storch via Phabricator via cfe-commits
    • [PATCH] D402... Jacob Bandes-Storch via Phabricator via cfe-commits
    • [PATCH] D402... Zhihao Yuan via Phabricator via cfe-commits
    • [PATCH] D402... Richard Smith - zygoloid via Phabricator via cfe-commits

Reply via email to