[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:30 PST 2024


================
@@ -1635,6 +1635,17 @@ void TypePrinter::printElaboratedBefore(const ElaboratedType *T,
     if (T->getKeyword() != ElaboratedTypeKeyword::None)
       OS << " ";
     NestedNameSpecifier *Qualifier = T->getQualifier();
+    if (!Policy.SuppressTagKeyword && Policy.SuppressScope &&
+        !Policy.SuppressUnwrittenScope) {
+      std::string prefix = T->isClassType()       ? "class "
+                           : T->isStructureType() ? "struct "
+                           : T->isUnionType()     ? "union "
+                                                  : "";
----------------
Sirraide wrote:

```suggestion
      StringRef prefix = T->isClassType()       ? "class "
                         : T->isStructureType() ? "struct "
                         : T->isUnionType()     ? "union "
                                                : "";
```

Don’t think we need a string here.

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


More information about the cfe-commits mailing list