================
@@ -20681,7 +20681,8 @@ ExprResult 
RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) {
   const FunctionType *FnType = CalleeType->castAs<FunctionType>();
 
   // Verify that this is a legal result type of a function.
-  if (DestType->isArrayType() || DestType->isFunctionType()) {
+  if ((DestType->isArrayType() && !S.getLangOpts().HLSL) ||
----------------
V-FEXrt wrote:

nit: Its probably a good idea to make a small helper function like
```
// HLSL allows arrays to be returned while C++ doesn't
static inline isReturnableArray(T, S) {
  return T->isArrayType() && S.getLangOpts().HLSL;
}
````

That way there is a tiny bit of "built in" documentation so someone in the 
future isn't confused but the extra HLSL check here

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

Reply via email to