Aadarsh-Keshri wrote:

I was able to eliminate ```Assertion `isa<To>(Val) && "cast<Ty>() argument of 
incompatible type!"'``` assertion failure by changing the 
```assert(DestTy->isFloatingType() && "unexpected type");``` to 
```assert(DestTy->isRealFloatingType() && "unexpected type");```

In SemaInit, I tried replacing ```isScalarType``` with something like 
```isIntgerType && !(isCompoundType || isPointerType)```. But that did fix 
anything.
 
 I even tried to add a guard in ```canInitializeArrayWithEmbedDataString``` but 
even that did not fix anything:
 ```c
 if (InitType->isArrayType()) {
    const ArrayType *InitArrayType = InitType->getAsArrayTypeUnsafe();
    auto ElementType = InitArrayType->getElementType();
    if(!ElementType->isIntegerType())
      return false;
    StringLiteral *SL = EE->getDataStringLiteral();
    return IsStringInit(SL, InitArrayType, Context) == SIF_None;
  }
 ```

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

Reply via email to