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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, we can pass something else there instead.

It would be nice if this worked to silence the warning though:

--- a/libstdc++-v3/include/std/stop_token
+++ b/libstdc++-v3/include/std/stop_token
@@ -395,10 +395,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     {
       _Stop_state_ref() = default;

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+      __attribute__((__access__(__none__, 1)))
       explicit
       _Stop_state_ref(const stop_source&)
       : _M_ptr(new _Stop_state_t())
       { }
+#pragma GCC diagnostic pop

       _Stop_state_ref(const _Stop_state_ref& __other) noexcept
       : _M_ptr(__other._M_ptr)

It has no effect at all (putting the pragmas around the caller works though).

Now that we have the access attribute, why doesn't access(none, N) help here?
It seems to express exactly what I want to express here, but the warning
doesn't care.

Reply via email to