Clang fails to silence the -Wunused-value warning in the following test-case: ``` @class Test; #define nil2 0 #define SOMETHING(macro) macro #define Expected(invocation) \ ({ \ SilenceWarning( \ Test *recorder = nil2; \ recorder; \ ); \ }) #define SilenceWarning(macro) \ ({ \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wunused-value\"") \ macro \ _Pragma("clang diagnostic pop") \ }) int test1() { return 5; } void foo(Test *other) { SOMETHING( Expected(test1()); ) } ``` Interestingly enough, if the use of `nil2` is replaced by `0` then the warning is suppressed correctly.
This appears to have been fixed since Clang 3.2.