[clang] [clang-cl] Fix value of __FUNCTION__ in MSVC mode. (PR #84014)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 18 07:37:25 PDT 2024


================
@@ -1022,7 +1045,17 @@ void DeclPrinter::VisitVarDecl(VarDecl *D) {
              ? D->getIdentifier()->deuglifiedName()
              : D->getName();
 
-  printDeclType(T, Name);
+  if (!Policy.SuppressTagKeyword && Policy.SuppressScope &&
+      !Policy.SuppressUnwrittenScope) {
+    AddPrefix(Policy, T, Out);
+    bool OldTagKeyword = Policy.SuppressTagKeyword;
+    bool OldSupressScope = Policy.SuppressScope;
+    printDeclType(T, Name);
+    Policy.SuppressTagKeyword = OldTagKeyword;
+    Policy.SuppressScope = OldSupressScope;
----------------
AaronBallman wrote:

Same here.

https://github.com/llvm/llvm-project/pull/84014


More information about the cfe-commits mailing list