================
@@ -1540,7 +1538,36 @@ namespace {
Designator.setInvalid();
return;
}
+
+ if(Base){
+ // Mark invalid and return early if Base points to an invalid decl
+ if(const auto *VD = Base.dyn_cast<const ValueDecl *>()){
+ if(VD->isInvalidDecl()){
+ Designator.setInvalid();
+ return;
+ }
+ }
+ // Mark invalid and return early if Base points to an invalid type
+ QualType BaseTy = getType(Base).getNonReferenceType();
+ if(BaseTy.isNull() || BaseTy->containsErrors() ||
(!BaseTy->isPointerType() && !BaseTy->isArrayType())){
+ Designator.setInvalid();
+ return;
+ }
+ }
+
----------------
zyn0217 wrote:
Are they relevant to the issue you claim to fix?
https://github.com/llvm/llvm-project/pull/235408
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits