[PATCH] D147744: [clang][Sema] Add MultiLevelTemplateArgumentList::dump()

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 15:47:23 PDT 2023


alexander-shaposhnikov added a comment.

for

  template <typename T1>
  struct X {
    template <int I2>
    struct Y {
      int f()
        requires(I2 == 1)
      {
        return 1;
      }
      int f()
        requires(I2 == 2)
      {
        return 1;
      }
    };
  };

this would print the following:

  NumRetainedOuterLevels: 0
  0: <T1>
  1: <I2>



================
Comment at: clang/include/clang/Sema/Template.h:271
+      llvm::errs() << "NumRetainedOuterLevels: " << NumRetainedOuterLevels << "\n";
+      for (unsigned Depth = NumRetainedOuterLevels; Depth < getNumLevels(); ++Depth) {
+        llvm::errs() << Depth << ": ";
----------------
https://github.com/llvm/llvm-project/blob/2279f77d2855d9caa0ece466462d34bcfdf4fb3d/clang/include/clang/Sema/Template.h#L155 (just in case)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147744



More information about the llvm-commits mailing list