<div dir="ltr"><div>Hi,</div><div><br></div>I'm having some issue with "opaque struct" being instantiated by Clang on unused reference arguments that have template types (that's an annoyance but not the topic of this email). I assume Clang decide to be lazy on the instantiation of unused arguments to save compile time.<div><br></div><div>But now I am wondering if that is actually a legal behavior in C++.</div><div>For example, the following code does not trigger the static_assert:<br><div><br></div><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,254)"><div><span style="color:rgb(0,0,255)">template</span><<span style="color:rgb(0,0,255)">int</span> N></div><div><span style="color:rgb(0,0,255)">struct</span> test {</div><div>    <span style="color:rgb(0,0,255)">static_assert</span>(N == <span style="color:rgb(9,136,90)">42</span>);</div><div>};</div><br><div><span style="color:rgb(0,0,255)">int</span> foo(test<<span style="color:rgb(9,136,90)">69</span>> &a) {</div><div>    <span style="color:rgb(0,0,255)">return</span> <span style="color:rgb(9,136,90)">0</span>;</div><div>}</div></div><div><br></div><div>Is that expected/desired behavior? (if you add "a = a;" then it will properly trigger it)</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div></div></div></div>