[PATCH] D33833: Fix PR 33189: Clang assertion on template destructor declaration

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 23 15:38:18 PDT 2017


hubert.reinterpretcast added a comment.

In https://reviews.llvm.org/D33833#789436, @kuang_he wrote:

> Can we get this patch reviewed by any chance?


@kuang_he; it is customary to "ping". In this case, "Ping 2".



================
Comment at: lib/AST/DeclCXX.cpp:1421
 
-  CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(R.front());
-  return Dtor;
+  return R.empty() ? nullptr : dyn_cast<CXXDestructorDecl>(R.front());
 }
----------------
I think what is here is probably what we want to do. My understanding is that the code is certainly invalid before we hit this, and the case is so odd that pursuing better recovery is not worthwhile.

Do we know if we can recover from getting a `FunctionTemplateDecl` by some other means? Perhaps by using the result of `getTemplatedDecl()`? I suspect there may be problems with cases where the //noexcept-specifier// is dependent.


https://reviews.llvm.org/D33833





More information about the cfe-commits mailing list