lebedev.ri added inline comments.
================ Comment at: test/clang-tidy/readability-unnecessary-intermediate-var.cpp:206 + auto test = 1; // Test +#ifdef INTERMITTENT_MACRO + return (test == 1); ---------------- tbourvon wrote: > lebedev.ri wrote: > > Tests are nice :) > > But please, add the test with assert-like macro.. > Sorry, I'm not sure I understand what kind of test you are suggesting... > Could you give me a short example? //Something// like this: (did not test at all, just back of the envelope code) ``` void die(); #ifndef NDEBUG #define assert(cond) void(0) // i.e. it does nothing #else #define assert(cond) (cond) ? void(0) : die(); #endif ``` ``` bool some_func(); bool f_preprocessor_macro2() { auto test = some_func(); assert(test); // <- should not be removed regardless of whether NDEBUG is set or not return test; } ``` Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D37014 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits