[lldb] [flang] [libunwind] [clang-tools-extra] [libcxx] [clang] [libc] [compiler-rt] [llvm] [lld] Fix clang to recognize new C23 modifiers %w and %wf when printing (PR #71771)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 1 04:54:06 PST 2023


================
@@ -537,8 +557,12 @@ ArgType PrintfSpecifier::getScalarArgType(ASTContext &Ctx,
             ArgType(Ctx.getPointerDiffType(), "ptrdiff_t"));
       case LengthModifier::AsAllocate:
       case LengthModifier::AsMAllocate:
-      case LengthModifier::AsWide:
         return ArgType::Invalid();
+      case LengthModifier::AsWide:
+      case LengthModifier::AsWideFast:
+        int s = getExplicitlyFixedSize();
+        bool fast = LM.getKind() == LengthModifier::AsWideFast ? true : false;
+        return clang::analyze_format_string::wToArgType(s, fast, Ctx);
----------------
AaronBallman wrote:

```suggestion
        int S = getExplicitlyFixedSize();
        bool Fast = LM.getKind() == LengthModifier::AsWideFast ? true : false;
        return clang::analyze_format_string::wToArgType(S, Fast, Ctx);
```
Same below.

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


More information about the cfe-commits mailing list