[llvm] r204659 - In Release modes, Visual Studio complains that the Operator destructor in User.cpp

Aaron Ballman aaron at aaronballman.com
Mon Mar 24 14:09:57 PDT 2014


On Mon, Mar 24, 2014 at 5:05 PM, Chandler Carruth <chandlerc at google.com> wrote:
>
> On Mon, Mar 24, 2014 at 12:48 PM, Yaron Keren <yaron.keren at gmail.com> wrote:
>>
>> +#if defined(_MSC_VER)
>> +// In Release modes, Visual Studio complains that the Operator destructor
>> +// never returns, which is true by design.
>> +// This does *not* depend on llvm_unreachable being dependent on NDEBUG:
>> +// even if llvm_unreachable is replaced by __assume(false), VC still
>> warns in
>> +// Release modes but not in Debug modes. The real reason is optimization
>> flags.
>> +// With /Od in Debug modes the warning is not issued whereas with /O1 it
>> is.
>> +// I could not find any documentation to this effect, it is reproducable:
>> +// Try compiling
>> http://msdn.microsoft.com/en-us/library/khwfyc5d(v=vs.90).aspx
>> +// with /O1 and then with /Od.
>> +// Anyhow, solution is same as lib/Support/Process.cpp:~self_process().
>> +
>> +#pragma warning(push)
>> +#pragma warning(disable:4722)
>
>
> Is this warning providing any value at all? I wonder if we should just
> disable it in cmake as low value. The fundamental error is well covered by
> Clang's existing warnings.

I'd be amenable to disabling this one in CMake. It doesn't seem like
it'd be a high-value diagnostic compared to the amount of pain working
around it.

~Aaron



More information about the llvm-commits mailing list