[libcxx-commits] [PATCH] D122474: demangler] Parenthesize >> inside template args

Nathan Sidwell via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Apr 4 06:36:25 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGee6ec9e861e6: [demangler] Parenthesize >> inside template args (authored by urnathan).
Herald added a project: libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++abi.

Changed prior to commit:
  https://reviews.llvm.org/D122474?vs=418656&id=420163#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122474/new/

https://reviews.llvm.org/D122474

Files:
  libcxxabi/src/demangle/ItaniumDemangle.h
  libcxxabi/test/test_demangle.pass.cpp
  llvm/include/llvm/Demangle/ItaniumDemangle.h


Index: llvm/include/llvm/Demangle/ItaniumDemangle.h
===================================================================
--- llvm/include/llvm/Demangle/ItaniumDemangle.h
+++ llvm/include/llvm/Demangle/ItaniumDemangle.h
@@ -1707,7 +1707,8 @@
   }
 
   void printLeft(OutputBuffer &OB) const override {
-    bool ParenAll = OB.isGtInsideTemplateArgs() && InfixOperator == ">";
+    bool ParenAll = OB.isGtInsideTemplateArgs() &&
+                    (InfixOperator == ">" || InfixOperator == ">>");
     if (ParenAll)
       OB.printOpen();
     // Assignment is right associative, with special LHS precedence.
Index: libcxxabi/test/test_demangle.pass.cpp
===================================================================
--- libcxxabi/test/test_demangle.pass.cpp
+++ libcxxabi/test/test_demangle.pass.cpp
@@ -29629,7 +29629,7 @@
     {"_ZN5Casts8implicitILj4EEEvPN9enable_ifIXrMT_Li4EEvE4typeE",
      "void Casts::implicit<4u>(enable_if<4u %= 4, void>::type*)"},
     {"_ZN5Casts8implicitILj4EEEvPN9enable_ifIXrsT_Li4EEvE4typeE",
-     "void Casts::implicit<4u>(enable_if<4u >> 4, void>::type*)"},
+     "void Casts::implicit<4u>(enable_if<(4u >> 4), void>::type*)"},
     {"_ZN5Casts8implicitILj4EEEvPN9enable_ifIXrST_Li4EEvE4typeE",
      "void Casts::implicit<4u>(enable_if<4u >>= 4, void>::type*)"},
     {"_Z1fPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP1XS13_S12_S11_S10_SZ_SY_SX_SW_SV_SU_ST_SS_SR_SQ_SP_SO_SN_SM_SL_SK_SJ_"
Index: libcxxabi/src/demangle/ItaniumDemangle.h
===================================================================
--- libcxxabi/src/demangle/ItaniumDemangle.h
+++ libcxxabi/src/demangle/ItaniumDemangle.h
@@ -1707,7 +1707,8 @@
   }
 
   void printLeft(OutputBuffer &OB) const override {
-    bool ParenAll = OB.isGtInsideTemplateArgs() && InfixOperator == ">";
+    bool ParenAll = OB.isGtInsideTemplateArgs() &&
+                    (InfixOperator == ">" || InfixOperator == ">>");
     if (ParenAll)
       OB.printOpen();
     // Assignment is right associative, with special LHS precedence.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122474.420163.patch
Type: text/x-patch
Size: 2023 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220404/508be34a/attachment.bin>


More information about the libcxx-commits mailing list