# Visual Studio VS 2017 15.8.0: Internal compiler error with NumericTraits

**URL:** <https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205>\
**Category:** Uncategorized\
**Created:** [August 16, 2018, 7:57pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205 "2018-08-16T19:57:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sophonet](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/ecccb3/32.png) [@Sophonet](https://discourse.itk.org/u/Sophonet)\
**Post date:** [August 16, 2018, 7:57pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/1 "2018-08-16T19:57:57Z")

</div>

Just for your information: I have filed a bug report here [https://developercommunity.visualstudio.com/content/problem/312703/vs-1580-internal-compiler-error.html](https://developercommunity.visualstudio.com/content/problem/312703/vs-1580-internal-compiler-error.html) - since itk’s NumericTraits::max() seem to cause a problem.

Best regards,

```
 sophonet
```

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [August 16, 2018, 8:26pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/2 "2018-08-16T20:26:17Z")

</div>

@Sophonet thank you for reporting the issue and mentioning the ticket here!

Other folks have noted internal compiler errors with the recently released VS 2017 15.8.0.

CC: @dzenanz @imikejackson

---

<div class="post-metadata">

**Author:** ![imikejackson](https://discourse.itk.org/user_avatar/discourse.itk.org/imikejackson/32/35_2.png) [@imikejackson](https://discourse.itk.org/u/imikejackson)\
**Post date:** [August 20, 2018, 1:36am UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/3 "2018-08-20T01:36:15Z")

</div>

I was able to redownload 15.7.5 (What ever the last version was) and install that until the bug gets worked out in ITK or VS.

Nice to know I was not the only one having the issue.

---

<div class="post-metadata">

**Author:** ![lassoan](https://discourse.itk.org/user_avatar/discourse.itk.org/lassoan/32/27_2.png) [@lassoan](https://discourse.itk.org/u/lassoan)\
**Post date:** [September 11, 2018, 4:34am UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/4 "2018-09-11T04:34:37Z")

</div>

[I’ve run into this, too](https://discourse.slicer.org/t/internal-compiler-error-in-simpleitk-while-building-slicer-with-latest-vs2015-compiler/4053), and it is quite annoying, because it is a lot of work to downgrade Visual Studio. While the error will be eventually fixed in Visual Studio, it would be great if ITK code could be simplified in the meantime so that these internal compiler errors are not triggered.

---

<div class="post-metadata">

**Author:** ![phcerdan](https://discourse.itk.org/user_avatar/discourse.itk.org/phcerdan/32/286_2.png) [@phcerdan](https://discourse.itk.org/u/phcerdan)\
**Post date:** [September 11, 2018, 5:41am UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/5 "2018-09-11T05:41:09Z")

</div>

> [@lassoan](#):
>
> While the error will be eventually fixed in Visual Studio

From [here](https://developercommunity.visualstudio.com/content/problem/313146/an-internal-compiler-error-occured-c-vs-1580.html), it seems that’s happening next week.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [September 11, 2018, 2:07pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/6 "2018-09-11T14:07:18Z")

</div>

This seems to be triggered by a combination of `constexpr` and `(void)` for parameters. I will give it a stab.

```nohighlight
Search "\(\s*void\s*\)" (5654 hits in 1558 files)

```

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [September 11, 2018, 3:51pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/7 "2018-09-11T15:51:42Z")

</div>

Here is a [patch](http://review.source.kitware.com/#/c/23701/). I guess that change to [`NumericTraits`](http://review.source.kitware.com/#/c/23701/1/Modules/Core/Common/include/itkNumericTraits.h) is the most important, because it combines the `constexpr` and `(void)` in a single declaration.

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [September 12, 2018, 3:29pm UTC](https://discourse.itk.org/t/visual-studio-vs-2017-15-8-0-internal-compiler-error-with-numerictraits/1205/8 "2018-09-12T15:29:10Z")

</div>

I merged the patch. Also, it looks like Microsoft [released](https://developercommunity.visualstudio.com/content/problem/313146/an-internal-compiler-error-occured-c-vs-1580.html) an update which fixes the bug, at least most instances of it.
