https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79671
--- Comment #48 from Bernd Edlinger <bernd.edlinger at hotmail dot de> --- (In reply to Jonathan Wakely from comment #47) > (In reply to Bernd Edlinger from comment #46) > > Yes, it seems, the __attribute__((may_alias)) does not propagate from > > structure members to enclosing structure: > > What enclosing structure? You're apparently agreeing with me, but saying > something different. In the real code, and the example above, _there_ _is_ > _no_ _enclosing_ _structure_. I understand that it doesn't propagate to > enclosing structures, that's fine. But if a type X has the attribute then it > doesn't need to propagate anywhere, it should affect X. But it doesn't fix > the original bug that started all this. I think I agree with you, that is surprising that the may_alias does not do what we need. I think the enclosing structure is: class function_base { public: function_base() : vtable(0) { } [...] public: detail::function::vtable_base* get_vtable() const { return reinterpret_cast<detail::function::vtable_base*>( reinterpret_cast<std::size_t>(vtable) & ~static_cast<std::size_t>(0x01)); } bool has_trivial_copy_and_destroy() const { return reinterpret_cast<std::size_t>(vtable) & 0x01; } detail::function::vtable_base* vtable; mutable detail::function::function_buffer functor; }; well, in fact even further down the class hierarchy. the offending statement is: this->functor = f.functor; I think, if a functor may in general alias to anything, it is possible that the outer object does not alias. Does that make sense?