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

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 08:03:23 PST 2024


================
@@ -3741,7 +3741,10 @@ ExprResult Sema::BuildPredefinedExpr(SourceLocation Loc,
   else {
     // Pre-defined identifiers are of type char[x], where x is the length of
     // the string.
-    auto Str = PredefinedExpr::ComputeName(IK, currentDecl);
+    bool ForceElaboratedPrinting =
+        IK == PredefinedIdentKind::Function && getLangOpts().MicrosoftExt;
----------------
Sirraide wrote:

```suggestion
        IK == PredefinedIdentKind::Function && getLangOpts().MSVCCompat;
```

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


More information about the cfe-commits mailing list