-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
Follows #137473 and #154394.
https://godbolt.org/z/zhsdnxKPe
using PA = void * __ptrauth(0,1,0);
template <class T> struct H { T t; };
static_assert(!__is_trivially_copyable(PA));
static_assert(__is_trivially_constructible(PA, PA&)); // WRONG
static_assert(__is_trivially_assignable(PA&, PA&)); // WRONG
static_assert(!__is_trivially_copyable(H<PA>));
static_assert(!__is_trivially_constructible(H<PA>, H<PA>&));
static_assert(!__is_trivially_assignable(H<PA>&, H<PA>&));
It cannot be that PA is trivially constructible and assignable by itself alone, but becomes non-trivial only when placed into a class type H. It also cannot be that PA is trivially constructible, assignable, and destructible, yet is not trivially_copyable. The conclusion is that PA must be non-trivial even when it is alone.
@ojhunt will you look please?
frederick-vs-ja
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"