[Bug c++/92104] __builtin_has_attribute in templates
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Oct 15 13:08:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92104
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |msebor at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase could be e.g.
template <typename T>
bool
has_packed ()
{
return __builtin_has_attribute (T (), packed);
}
struct __attribute__((packed)) S { char a, b, c, d; };
bool p = has_packed<S> ();
or similar.
More information about the Gcc-bugs
mailing list