std::aligned_storage and [[gnu::may_alias]]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does std::aligned_storage need a [[gnu::may_alias]] attribute?


According to http://en.cppreference.com/w/cpp/language/reinterpret_cast#Type_aliasing, it is not legal to cast a char array into another type (that is not a relative of char*).


According to the example in http://en.cppreference.com/w/cpp/types/aligned_storage, it's perfectly all right to cast std::aligned_storage::data to some arbitrary T; and it would be hard to find a use for aligned_storage without it.


std::function uses [[gnu::may_alias]] in a situation where std::aligned_storage may be used.


Is this a problem in libstdc++, the standard, or my understanding of the strict aliasing rules?




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux