================
@@ -2009,7 +2009,8 @@ class ClassTemplateSpecializationDecl : public 
CXXRecordDecl,
   /// Retrieve the template argument list as written in the sources,
   /// if any.
   const ASTTemplateArgumentListInfo *getTemplateArgsAsWritten() const {
-    if (auto *Info = ExplicitInfo.dyn_cast<ExplicitInstantiationInfo *>())
+    if (auto *Info =
+            dyn_cast_if_present<ExplicitInstantiationInfo *>(ExplicitInfo))
----------------
nikic wrote:

I'm a bit confused by this one. I'd have expected dyn_cast to work here, given 
the following cast. Or is this the weird case where cast on the non-first 
pointer union member accepts null?

https://github.com/llvm/llvm-project/pull/124425
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to