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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 10:03:49 PST 2024


================
@@ -3740,7 +3740,11 @@ 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 = false;
+    if (IK == PredefinedIdentKind::Function && getLangOpts().MicrosoftExt)
+      ForceElaboratedPrinting = true;
----------------
AaronBallman wrote:

```suggestion
    bool ForceElaboratedPrinting = IK == PredefinedIdentKind::Function && getLangOpts().MicrosoftExt;
```

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


More information about the cfe-commits mailing list