<div dir="auto">Also, I'm not sure a static assert pointing to the stable name in the standard is helpful to our users. Will they even know what it is?<div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 8, 2023, 3:20 PM Eric Fiselier via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">EricWF added a comment.<br>
<br>
Why?<br>
<br>
We went out of our way to make `declval` as low cost as we possibly could. Adding a body for the compiler to see is just work.<br>
<br>
In D145376#4176608 <<a href="https://reviews.llvm.org/D145376#4176608" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D145376#4176608</a>>, @fsb4000 wrote:<br>
<br>
> @EricWF<br>
><br>
> What do you mean?<br>
><br>
> The change is correct.<br>
><br>
> You mean gcc and clang compiler frontends have bugs?<br>
><br>
> By the way libstdc++ has the static_assert since Nov 13, 2009 (<a href="https://github.com/gcc-mirror/gcc/commit/7274deff738213914a31413a9d1a671020694175" rel="noreferrer noreferrer" target="_blank">https://github.com/gcc-mirror/gcc/commit/7274deff738213914a31413a9d1a671020694175</a>)<br>
><br>
> and GCC failed "error: static assertion failed: declval() must not be used!"<br>
><br>
> <a href="https://gcc.godbolt.org/z/MssGMMqsd" rel="noreferrer noreferrer" target="_blank">https://gcc.godbolt.org/z/MssGMMqsd</a><br>
><br>
> I see that MSVC works with that example: <a href="https://gcc.godbolt.org/z/cjE8dard7" rel="noreferrer noreferrer" target="_blank">https://gcc.godbolt.org/z/cjE8dard7</a><br>
><br>
> However it has the same library implementation...<br>
<br>
Cool. Thanks for the archaeology. But even if they're bugs, it means we break code. So this change isn't going anywhere as-is until<br>
the different compilers converge on a behavior.<br>
<br>
In the meantime, If you want to produce a better diagnostics in cases where the thing is ODR used, you can use the `__attribute__((unavailable))` to do that.<br>
<br>
<br>
CHANGES SINCE LAST ACTION<br>
  <a href="https://reviews.llvm.org/D145376/new/" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D145376/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D145376" rel="noreferrer noreferrer" target="_blank">https://reviews.llvm.org/D145376</a><br>
<br>
</blockquote></div>