https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109606

--- Comment #3 from Alexander <akaraevz at mail dot ru> ---
(In reply to Jonathan Wakely from comment #1)
> Yes. Using libstdc++ headers with older **or newer** versions of GCC is
> completely unsupported. For other compilers, they need to be sufficiently
> close to GCC, which means they should support built-ins added to GCC 10 by
> now.
Thanks you for explanation. Usage of `_GLIBCXX_HAVE_BUILTIN_IS_SAME` confused
me, I expected that all `__same_as` usages should be guarded by this flag.

> That was added some years ago, and I've been thinking of simplifying it.
> 
> Do you actually see a problem with any real compiler?
There's no problem with any real compiler (at least for me), however the
problem exists for ReSharper C++ (tracking issue:
https://youtrack.jetbrains.com/issue/RSCPP-34115). Amongst other, ReSharper has
its own preprocessor and also constexpr evaluation engine where `__same_as`
built-in was marked as supported only in clang. We missed that gcc-10 started
supporting it too. It wasn't an issue before, because we simply returned
`false` from `__has_builtin(__same_as)` for gcc and everything worked fine with
fallback to naive implementation (i.e. for `std::is_same`). Of course, we'll
fix this issue on our side, providing `__same_as` for gcc-10 (and later) too.

Reply via email to