aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM!



================
Comment at: clang/lib/Sema/SemaChecking.cpp:17761-17766
+  for (int I = 0; I < 3; ++I) {
+    ExprResult Converted = UsualUnaryConversions(TheCall->getArg(I));
+    if (Converted.isInvalid())
+      return true;
+    Args[I] = Converted.get();
+  }
----------------
arsenm wrote:
> aaron.ballman wrote:
> > This will cause conversions to happen *before* we check whether the types 
> > are the same; is that expected? e.g., it seems like this would allow you to 
> > pass a float and a double and thanks to the magic of usual unary 
> > conversions they both come out as double and thus don't get diagnosed.
> The tests say that isn't happening, e.g. here:
> 
> 
> ```
> 
>   f32 = __builtin_elementwise_fma(f64, f32, f32);
>   // expected-error@-1 {{arguments are of different types ('double' vs 
> 'float')}}
> 
>   f32 = __builtin_elementwise_fma(f32, f64, f32);
>   // expected-error@-1 {{arguments are of different types ('float' vs 
> 'double')}}
> 
> ```
Oh, excellent, thank you!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140992/new/

https://reviews.llvm.org/D140992

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to