<div class="gmail_quote">On Wed, Aug 29, 2012 at 3:38 AM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Aug 29, 2012 at 10:40 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> On Wed, Aug 29, 2012 at 2:20 AM, Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br>
</div><div class="im">>> Thanks, Richard! Fixed in r162837.<br>
><br>
> Thanks.<br>
><br>
> I've looked into what's specified for C++11 constant expression semantics,<br>
> and it looks like this isn't the correct behavior there. C++11 thread_local<br>
> variables *can* be used in core constant expressions, but can't be part of<br>
> the eventual result of constant expression evaluation. It looks like the<br>
> check belongs in CheckLValueConstantExpression instead.<br>
><br>
> For instance, this is valid under the C++11 rules:<br>
><br>
> thread_local int n;<br>
> constexpr bool b = &n == &n;<br>
<br>
</div>I guess I'm out of my depth here, because I don't really know how<br>
these things work.</blockquote><div><br></div><div>When it comes to the interactions of constexpr and thread_local, I think almost no-one does.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does the attached patch look like it's doing the<br>
right thing?<br></blockquote><div><br></div><div>LGTM</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for looking into this.<br></blockquote><div><br></div><div>Likewise!</div></div>