[PATCH] D80153: [AST] Mangle LambdaContextDecl for top level decl

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 19 13:10:50 PDT 2020


zequanwu marked an inline comment as done.
zequanwu added inline comments.


================
Comment at: clang/lib/AST/MicrosoftMangle.cpp:950-952
           // If the context of a closure type is an initializer for a class
-          // member (static or nonstatic), it is encoded in a qualified name.
+          // member (static or nonstatic) or is a top level decl, it is encoded
+          // in a qualified name.
----------------
zequanwu wrote:
> rnk wrote:
> > Will this fix work if the inline variable is in a namespace, or inline function?
> > 
> > This code seems like maybe it should live in `getEffectiveDeclContext`. Are you sure the fix won't be there?
> Because whenever we got a `LambdaExpr` and it is inside `VarDecl`, we want to add `@[varaible]` after `@<lambda_1>`. So, the demangled result will have `[variable]::<lambda_1>`. 
> 
> I think we should remove the check for record and translation unit.
Otherwise, the fix won't work if inline variable is inside namespace.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80153





More information about the cfe-commits mailing list