[PATCH] D142632: [clang][TypePrinter] Support expression template arguments when checking defaultedness

Michael Buch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 26 11:11:07 PST 2023


Michael137 added inline comments.


================
Comment at: clang/lib/AST/TypePrinter.cpp:2019
+  // Can't evaluate value-dependent expressions so bail early
+  Expr const *pattern_expr = Pattern.getAsExpr();
+  if (pattern_expr->isValueDependent() ||
----------------
aprantl wrote:
> I assume you checked that this is always non-null?
I didn't add a null-check because no other caller around clang does it (including `isSubstitutedTemplateArgument` which precedes this call here). So we've already been doing this on top-of-tree for a while in this codepath. But may be worth a followup audit. Though I suspect the assumption is that we never construct `TemplateArgument`s with `nullptr` `Expr`s. @erichkeane may know some more about this


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142632



More information about the cfe-commits mailing list