[PATCH] D21145: [Sema] Fix crash on valid where instantiation of lambda cannot access type of 'this'

Faisal Vali via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 12 16:39:40 PDT 2016


faisalv added a comment.

Hmm - after having given this some more thought - I'm not as confident about the best approach.  Should we leverage the CXXThisTypeOverride mechanism (as you had done in your initial patch) - and remove the computation entirely from getCurrentThisType - or just remove CXXThisTypeOverride entirely and have getCurrentThisType be smart enough to always figure out the 'this' type? Admittedly, my slight bias is to smarty-pantify getCurrentThisType (and just remove CXXThisTypeOverride if we can do it for all cases) - but I'd be interested in the counterarguments against that.  Does it really make sense to leverage and maintain both approaches within the code-base?

Richard you have any thoughts on this (pun ;)?

Apologies Erik, for the waffle here - and thanks again for putting time into it.


================
Comment at: lib/Sema/SemaExprCXX.cpp:971
@@ +970,3 @@
+      !ActiveTemplateInstantiations.empty()) {
+
+    // This is a lambda call operator that is being instantiated as a default
----------------
I wonder if we could just check that 'DC' is a CXXRecordDecl  and just use it (so avoid computing it again below)?


http://reviews.llvm.org/D21145





More information about the cfe-commits mailing list