[PATCH] D122586: Fix template instantiation of UDLs

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 08:09:07 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/lib/Sema/TreeTransform.h:10516
 TreeTransform<Derived>::TransformUserDefinedLiteral(UserDefinedLiteral *E) {
-  if (FunctionDecl *FD = E->getDirectCallee())
-    SemaRef.MarkFunctionReferenced(E->getBeginLoc(), FD);
-  return SemaRef.MaybeBindToTemporary(E);
+  return TransformCallExpr(E);
 }
----------------
aaron.ballman wrote:
> cor3ntin wrote:
> > erichkeane wrote:
> > > I THINK you have to do this by doing `getDerived().TransformCallExpr(E)`.  
> > > 
> > Oh yes, good point
> Hmmm, don't we want this level of transformation to kick in, not the derived? e.g., another approach would be to remove the definition of this function entirely so that the recursive AST visitor calls `TransformCallExpr()` instead?
No, the idea is that `TreeTransform` is inherited by other 'instantiator' types.  IF those types do something special for `CallExpr`, we want this to ALSO do the same thing as `CallExpr`.  

I was also thinking about removing the function altogether.  I just couldn't remember if `TreeTransform` did that right :) I'd suggest that if possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122586



More information about the cfe-commits mailing list