 <p>Works for me (VS 2015 / v140) with the following minor modification:</p> <pre><code>#include &lt;iostream&gt; struct A {}; struct B {}; constexpr A aaa = {}; constexpr B bbb = {}; using A_type = decltype(aaa); using B_type = decltype(bbb); template &lt;typename T&gt; void foo(T, A_type) { std::cout &lt;&lt; "a"; } template &lt;typename T&gt; void foo(T, B_type) { std::cout &lt;&lt; "b"; } int main() { foo(0, aaa); foo(0, bbb); } </code></pre> <p>But this variant yields the same error (not sure what to make of it):</p> <pre><code>template &lt;typename T&gt; struct TypeWrapper { using type = T; }; template &lt;typename T&gt; void foo(T, typename TypeWrapper&lt;decltype(aaa)&gt;::type) { std::cout &lt;&lt; "a"; } template &lt;typename T&gt; void foo(T, typename TypeWrapper&lt;decltype(bbb)&gt;::type) { std::cout &lt;&lt; "b"; } </code></pre>