[addressof] Intel C++ 13 Warning (Cannot be suppressed)

addressof.hpp causes a warning under Intel C++ 13 when using the highest warning level, which cannot be suppressed using the regular #pragma directives. This causes problems when compiling user code with warnings as errors, as the header causes an error which cannot be disabled. The root of the issue seems to be that ICC thinks that an rvalue is being passed to a function which takes a non-const ref, however in this case I think it's a false positive (ICC apparently isn't smart enough to notice and analyze the implicit conversion operator). My simple workaround is to turn the temporary into an lvalue and pass that instead. After making this change I tested under MSVC 12, GCC 4.7, ICC 13, and Clang 3.1 (all under Windows) and recorded no changes in number of failed compiles or tests. Is this an acceptable change that could be merged into trunk? Thanks.

On Sun, Oct 14, 2012 at 6:39 AM, Joshua Boyce <raptorfactor@raptorfactor.com
wrote:
addressof.hpp causes a warning under Intel C++ 13 when using the highest warning level, which cannot be suppressed using the regular #pragma directives. This causes problems when compiling user code with warnings as errors, as the header causes an error which cannot be disabled. The root of the issue seems to be that ICC thinks that an rvalue is being passed to a function which takes a non-const ref, however in this case I think it's a false positive (ICC apparently isn't smart enough to notice and analyze the implicit conversion operator). My simple workaround is to turn the temporary into an lvalue and pass that instead.
After making this change I tested under MSVC 12, GCC 4.7, ICC 13, and Clang 3.1 (all under Windows) and recorded no changes in number of failed compiles or tests. Is this an acceptable change that could be merged into trunk?
Thanks.
Err, slight correction, that should read MSVC 11 (aka MSVC 2012).
participants (1)
-
Joshua Boyce