[PATCH] D120905: [demangler] Add operator precedence
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 24 13:21:50 PDT 2022
rjmccall added inline comments.
================
Comment at: libcxxabi/src/demangle/ItaniumDemangle.h:1788
void printLeft(OutputBuffer &OB) const override {
- // might be a template argument expression, then we need to disambiguate
- // with parens.
- if (InfixOperator == ">")
- OB += "(";
-
- OB += "(";
- LHS->print(OB);
- OB += ") ";
+ bool ParenAll = OB.isGtInsideTemplateArgs() && InfixOperator == ">";
+ if (ParenAll)
----------------
Does this not need to apply to `>>` for some reason, or does demangling just have a longstanding bug?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120905/new/
https://reviews.llvm.org/D120905
More information about the llvm-commits
mailing list