jfb added a comment.

Why have `.c` and `.cpp` tests?



================
Comment at: test/Sema/warn-xor-as-pow.c:43
+  res = TWO_ULL ^ 16;
+  res = 2 ^ 32; // expected-warning {{result of '2 ^ 32' is 34; maybe you mean 
'1<<32', but shift count >= width of type}}
+  // expected-note@-1 {{replace expression with '(2) ^ 32' to silence this 
warning}}
----------------
I think we want to suggest `1LL << 32` or something like that. Whatever we 
usually do with this type of suggestion.


================
Comment at: test/Sema/warn-xor-as-pow.c:45
+  // expected-note@-1 {{replace expression with '(2) ^ 32' to silence this 
warning}}
+  res = 2 ^ 64; // expected-warning {{result of '2 ^ 64' is 66; maybe you mean 
'1<<64', but shift count >= width of type}}
+  // expected-note@-1 {{replace expression with '(2) ^ 64' to silence this 
warning}}
----------------
This one hits a ceiling, we can't really suggest anything for this value IMO. 
Maybe we need to see if the user is doing `2^64 - 1`? In that case we can offer 
a suggestion.


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

https://reviews.llvm.org/D63423



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

Reply via email to