[llvm] r260654 - [ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 08:14:54 PST 2016


On Fri, Feb 12, 2016 at 10:58 AM, Argyrios Kyrtzidis <akyrtzi at gmail.com> wrote:
>
>> On Feb 12, 2016, at 5:08 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>
>> On Thu, Feb 11, 2016 at 11:36 PM, Argyrios Kyrtzidis via llvm-commits
>> <llvm-commits at lists.llvm.org> wrote:
>>> Author: akirtzidis
>>> Date: Thu Feb 11 22:36:48 2016
>>> New Revision: 260654
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=260654&view=rev
>>> Log:
>>> [ADT] OptionSet: ifdef out some code that seems to be crashing MSVC.
>>>
>>> Modified:
>>>    llvm/trunk/include/llvm/ADT/OptionSet.h
>>>
>>> Modified: llvm/trunk/include/llvm/ADT/OptionSet.h
>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/OptionSet.h?rev=260654&r1=260653&r2=260654&view=diff
>>> ==============================================================================
>>> --- llvm/trunk/include/llvm/ADT/OptionSet.h (original)
>>> +++ llvm/trunk/include/llvm/ADT/OptionSet.h Thu Feb 11 22:36:48 2016
>>> @@ -116,6 +116,8 @@ public:
>>>   }
>>>
>>> private:
>>> +#ifndef _MSC_VER
>>> +  // This is crashing MSVC.
>>>   template <typename T>
>>>   static auto _checkResultTypeOperatorOr(T t) -> decltype(t | t) { return T(); }
>>>
>>> @@ -124,6 +126,7 @@ private:
>>>   static_assert(!std::is_same<decltype(_checkResultTypeOperatorOr(Flags())),
>>>                               Flags>::value,
>>>                 "operator| should produce an OptionSet");
>>> +#endif
>>> };
>>
>> Are there plans to correct this for MSVC and recommit? Is there a
>> requirement for this to use automatic type deduction instead of using
>> the decltype in the is_same check, like this:
>>
>> http://coliru.stacked-crooked.com/a/94f224987d9feaee
>
> + Jordan who added that.
>
>>
>> This compiles fine in MSVC 2015, uncertain what MSVC was crashing for
>> you however.
>
> I was going by the bots:
>
> http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/6315
> http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/9718
>
> To clarify, did you not reproduce a crash with the original code ?

No, it does not crash in MSVC 2015, but those bots imply it crashes
with MSVC 2013. I cannot reproduce the crash with a reduced test in
MSVC 2013, either. I can try a full build in MSVC 2013, but it'll take
a while.

~Aaron


More information about the llvm-commits mailing list