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

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to pavlick from comment #5)
> Why is there false positive and no warning about the unsupported feature
> (atomic_thread_fence)?

You are probably using an old version of gcc. With a recent one, this prints

In function 'void std::atomic_thread_fence(std::memory_order)',
    inlined from 'void Test::add()' at 3.cc:14:22:
/usr/lib/gcc-snapshot/include/c++/12/bits/atomic_base.h:126:26: warning:
'atomic_thread_fence' is not supported with '-fsanitize=thread' [-Wtsan]
  126 |   { __atomic_thread_fence(int(__m)); }
      |     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Reply via email to