================
@@ -11427,6 +11427,19 @@ static void AnalyzeImplicitConversions(
     return;
   }
 
+  if (auto *OutArgE = dyn_cast<HLSLOutArgExpr>(E)) {
+    // The base expression is only used to initialize the parameter for
+    // arguments to `inout` parameters, so we only traverse down the base
+    // expression for `inout` cases.
----------------
llvm-beanz wrote:

I should have commented on this. If SemaChecking traverses down both sides we 
get warnings for the conversion that would "initialize" the `out` parameter, 
but those warnings aren't accurate because no initialization occurs.

If we only traverse down the write back side we only get the warning for the 
copy back to the l-value, which is the behavior we want.

clang/test/SemaHLSL/Language/OutputParameters.hlsl verifies the behavior for 
`out` arguments of only diagnosing the write back conversion, removing the 
condition breaks that test by emitting diagnostics on the initialization as 
well.

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

Reply via email to