[PATCH] D122586: Fix template instantiation of UDLs

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 08:05:26 PDT 2022


aaron.ballman 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);
 }
----------------
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?


================
Comment at: clang/test/CodeGenCXX/cxx20-consteval-crash.cpp:28
+
+namespace Issue54578 {
+inline consteval unsigned char operator""_UC(const unsigned long long n) {
----------------
cor3ntin wrote:
> I've used things like `ghXXXX` previously. for my own curiosity, is there a convention here?
I don't know if we've organically gotten a convention here yet or not. I've been using `Issue` for mine, but don't have a strong preference either.


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