title: Why does this partial specialization generate a compiler error (SFINAE issue)
body: <p>Can someone confirm whether the partial specialization below should kick in on LINE 1 in <code>main()</code> (targeting Visual Studio 2013 and/or 2015).</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;type_traits&gt;
  #include &lt;vector&gt;
  #include &lt;utility&gt;
  
  using Iter = std::vector&lt;int&gt;::const_iterator;
  
  template&lt;typename, typename = void &gt;
  struct IsIterator : std::false_type
  {
      using primary = bool;
  };
  
  template&lt;typename T&gt;
  struct IsIterator&lt; T, std::enable_if_t&lt; !std::is_void&lt;decltype(*std::declval&lt;T&gt;())&gt;::value &gt; &gt;
      : std::true_type
  {
      using partial = bool;
  };
  
  int main()
  {
      IsIterator&lt;Iter&gt;::partial whatever; // LINE 1
      bool test = !std::is_void&lt;decltype(*std::declval&lt;Iter&gt;())&gt;::value; // LINE 2
  
      return 0;
  }
  </code></pre>
  
  <p>I believe it should based on the standard but LINE 1 fails with an "internal compiler" error in VS2013, and in VS2015 it fails with the following:</p>
  
  <pre><code>'partial': is not a member of 'IsIterator&lt;Iter,void&gt;'
  </code></pre>
  
  <p>I'm therefore confined to testing it in VS 2015 only (due to the internal compiler error in VS2013) but even in VS2015, where it compiles fine when set to "primary", this doesn't appear correct to me. It should be "partial" AFAIK. Moreover:</p>
  
  <ol>
  <li>"partial" is deemed correct when compiled at <a href="http://coliru.stacked-crooked.com/" rel="nofollow">http://coliru.stacked-crooked.com/</a></li>
  <li>If LINE 1 is commented out in <code>main()</code> to eliminate the error then LINE 2 returns true as expected (the same code seen in the specialization), so I wouldn't expect the above error when LINE 1
  is uncommented (the specialization should kick in so <code>partial</code> should exist)</li>
  <li>Visual Studio's Intellisense sometimes shows me that "partial" is correct, and other times it's incorrect. Even when showing me it's correct though, compiling still fails. The behaviour is flaky, and a definite bug I can reproduce.</li>
  <li>If I simply replace
  <code>!std::is_void&lt;decltype(*std::declval&lt;T&gt;())&gt;::value</code> with <code>true</code> then it compiles fine with LINE 1 set to <code>partial</code>.</li>
  </ol>
  
  <p>It appears to me that "partial" applies based on the standard (can someone confirm this), and if so, then Visual Studio has a bug (and not just the Intellisense bug). This type of code can be very subtle however so maybe someone can shed some light (if I missed something). Thanks.</p>