hwright added a comment.

@aaron.ballman I am both grateful and sad that I don't possess the same macro 
creativity as you do. :)

(I'm also sad that the various clang APIs aren't as well documented as I hoped. 
 The current solution works well, but it took a while and a bit of consultation 
with some other llvm'ers to get it right.)



================
Comment at: test/clang-tidy/abseil-duration-comparison.cpp:146
+#define VALUE_IF_2(e) (e)
+#define VALUE_IF(v, e, type) (v ? VALUE_IF_2(absl::To##type##Seconds(e)) : 0)
+  int a3 = VALUE_IF(1, d1, Double);
----------------
aaron.ballman wrote:
> What if this is changed to:
> ```
> #define VALUE_IF(v, e, type) (v ? (5 > 
> VALUE_IF_2(absl::To##type##Seconds(e))) : 0)
> ```
This also doesn't transform.


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

https://reviews.llvm.org/D55784



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

Reply via email to