<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi,</p>
<p><br>
</p>
<p>I have a small code fragment that clang doesn't like, but seems valid to me and gcc is fine with it.</p>
<p><br>
</p>
<p></p>
<div><span style="font-family: Consolas, monospace;">template <int> struct Wrapper;</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, monospace;">template <int I> struct Lookup {</span></div>
<div><span style="font-family: Consolas, monospace;">  template <typename> struct Helper;</span></div>
<div><span style="font-family: Consolas, monospace;">  using Type = typename Helper<Wrapper<I>>::Type;</span></div>
<div><span style="font-family: Consolas, monospace;">};</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, monospace;">template <int I> </span><span style="font-family: Consolas, monospace; font-size: 12pt;">template <int J></span></div>
<div><span style="font-family: Consolas, monospace;">struct Lookup<I>::Helper<Wrapper<J>> {</span></div>
<div><span style="font-family: Consolas, monospace;">  using Type = void;</span></div>
<div><span style="font-family: Consolas, monospace;">};</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, monospace;">using A = typename Lookup<12>::Type; // should be void</span></div>
<div></div>
<p></p>
<p><br>
</p>
<p>So, is the code wrong, or is clang wrong?!  I have tested with clang 3.8 and 3.9 and gcc 6.1.</p>
<p><br>
</p>
<p>Thanks for your thoughts.</p>
<p><br>
</p>
<p>Andy</p>
<p><br>
</p>
</div>
</body>
</html>