[clang] -ast-dump-decl-types crashes on codes involving concepts #94928 (PR #108142)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 07:19:54 PDT 2024


================
@@ -101,7 +101,8 @@ namespace {
       if (DumpDeclTypes) {
         Decl *InnerD = D;
         if (auto *TD = dyn_cast<TemplateDecl>(D))
-          InnerD = TD->getTemplatedDecl();
+          if (TD->getTemplatedDecl())
+            InnerD = TD->getTemplatedDecl();
----------------
AaronBallman wrote:

```suggestion
          if (Decl *TempD = TD->getTemplatedDecl())
            InnerD = TempD;
```

https://github.com/llvm/llvm-project/pull/108142


More information about the cfe-commits mailing list