================
@@ -525,7 +525,16 @@ class ASTNodeTraverser
     Visit(TL.getSizeExpr());
   }
   void VisitDependentSizedExtVectorTypeLoc(DependentSizedExtVectorTypeLoc TL) {
-    Visit(cast<DependentSizedExtVectorType>(TL.getType())->getSizeExpr());
+    Expr *Size = TL.getSizeExpr();
+    Visit(Size ? Size : TL.getTypePtr()->getSizeExpr());
+  }
+  void VisitVectorTypeLoc(VectorTypeLoc TL) {
+    if (Expr *Size = TL.getSizeExpr())
+      Visit(Size);
+  }
+  void VisitDependentVectorTypeLoc(DependentVectorTypeLoc TL) {
+    Expr *Size = TL.getSizeExpr();
+    Visit(Size ? Size : TL.getTypePtr()->getSizeExpr());
----------------
zwuis wrote:

When is `TL.getSizeExpr()` null but `TL.getTypePtr()->getSizeExpr()` isn't?

https://github.com/llvm/llvm-project/pull/229328
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to