<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Nov 30, 2011, at 11:54 AM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div>My concern, however, is that this approach is still fundamentally flawed.  By analyzing the instantiations, we are still impacted by the control-flow of that particular instantiation.  For example, suppose we have:</div><div><br></div><div>template <typename T> void foo() {</div><div>  {</div><div>    T x;</div><div>  }</div><div>  printf("is this dead?");</div><div>}</div><div><br></div><div>If the instantiated type for 'T' has a 'noreturn' destructor, then the printf() call is unreachable.  If it doesn't, it is reachable.</div></span></blockquote></div><br><div>A simpler example:</div><div><br></div><div>template <typename T> void foo() {</div><div>  T::bar();</div><div>  printf("is this dead?");</div><div>}</div><div><br></div><div>Same issue as before.  'bar()' could be marked 'noreturn', but it depends on the instantiation.  Thus control-flow could vary significantly between instantiations.</div></body></html>