<div dir="ltr"><div>+    if (EIA->getCond()->isValueDependent()) {<br></div><div>+      // Don't even try now, we'll examine it after instantiation.</div><div>+      continue;</div><div>+    }</div><div><br></div><div>Is this sufficient? Suppose we have:</div><div><br></div><div>template<bool B> struct S {</div><div>  void f() __attribute__((enable_if(B, "")));</div><div>  void f() __attribute__((enable_if(!B, "")));<br></div><div>  void g() { f(); }</div><div>};</div><div><br></div><div>Will we reject the template due to the amiguity in overload resolution for f()? (If not, what saves us?) Likewise for:</div><div><br></div><div><div>template<bool B> struct S {</div><div>  void f(bool b) __attribute__((enable_if(b, "")));</div><div>  void f(bool b) __attribute__((enable_if(!b, "")));</div><div>  void g() { f(B); }</div><div>};</div></div><div><br></div><div><br></div><div><div>+// FIXME: issue an error (without instantiation) because h(T()) is not</div><div>+// convertible to bool, because return types aren't overloadable.</div><div>+void h(int);</div><div>+template <typename T> void outer() {</div><div>+  void local_function() __attribute__((enable_if(h(T()), "")));</div><div>+  local_function();</div><div>+};</div></div><div><br></div><div>This FIXME doesn't seem correct: a different 'h' could be found by ADL, and it could be a constexpr function returning bool. What happens if you use ::h instead?</div><div><br></div><div>LGTM with the FIXME corrected; we can fix the semantics of the dependent case (if it's not working) after the crash is fixed.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 8, 2014 at 8:43 PM, Nick Lewycky <span dir="ltr"><<a href="mailto:nlewycky@google.com" target="_blank">nlewycky@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The attached patch improves our handling of value dependent expressions in attribute((enable_if)), both in the condition expression and at the call site. Fixes PR20988.<div><br></div><div>Please review!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nick</div><div><br></div></font></span></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div>