Internal compiler error in SimpleITK while building Slicer with latest VS2015 compiler

I’ve recently updated my VS2015 compiler (used in VS2017 IDE) to “Microsoft ® Build Engine version 15.8.168+ga8fba1ebd7 for .NET Framework”. With this compiler, I often get compiler crash while trying to build SimpleITK’s sitkScalarConnectedComponentImageFilter:

  sitkScalarConnectedComponentImageFilter.cxx

c:\d\s4r\itkv4\modules\segmentation\connectedcomponents\include\itkconnectedcomponentfunctorimagefilter.hxx(41): fatal error C1001: An internal error has occurred in the compiler. [C:\D\S4R\SimpleITK-build\SimpleITK-build\Code\BasicFilters\src\SimpleITK_ITKConnectedComponents.vcxproj] [C:\D\S4R\SimpleITK-build\SimpleITK.vcxproj] [C:\D\S4R\SimpleITK.vcxproj]
 
      (compiler file 'msc1.cpp', line 1518)
 
       To work around this problem, try simplifying or changing the program near the locations listed above.

See full logs here: https://pastebin.com/giSZD6T2

I’ve never had this problem on other computers with VS2017 IDE / VS2015 toolset version “Microsoft ® Build Engine version 15.7.180.61344 for .NET Framework”.

Has anyone else come across this issue?

@blowekamp do you have any suggestion?

ITK had a report of issues with VS 2017 15.8.0: