[llvm] [LLVM Demangler] Set `InConstraintExpr` to `true` when demangling a c… (PR #107385)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 04:39:17 PDT 2024


https://github.com/VitaNuo created https://github.com/llvm/llvm-project/pull/107385

…onstraint expression.

This prevents demangler failures before the TODO in the [demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678).

>From c0d56a920b7c9e9f65b568d9694fba6266b305bf Mon Sep 17 00:00:00 2001
From: Viktoriia Bakalova <bakalova at google.com>
Date: Thu, 5 Sep 2024 11:38:23 +0000
Subject: [PATCH] [LLVM Demangler] Set `InConstraintExpr` to `true` when
 demangling a constraint expression. This prevents demangler failures before
 the TODO in the
 [demangler](https://github.com/llvm/llvm-project/blob/3e070906eff720dc44aee86e533e12aafc8bb14b/llvm/include/llvm/Demangle/ItaniumDemangle.h#L5678).

---
 llvm/include/llvm/Demangle/ItaniumDemangle.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/Demangle/ItaniumDemangle.h b/llvm/include/llvm/Demangle/ItaniumDemangle.h
index fb2060fa07f724..5c044def74e881 100644
--- a/llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ b/llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -5737,6 +5737,7 @@ Node *AbstractManglingParser<Derived, Alloc>::parseTemplateParamDecl(
   }
 
   if (consumeIf("Tk")) {
+    ScopedOverride<bool> SaveInConstraintExpr(InConstraintExpr, true);
     Node *Constraint = getDerived().parseName();
     if (!Constraint)
       return nullptr;



More information about the llvm-commits mailing list