Skip to content

New __ptrauth scalar types are wrongly reported as trivially copy/move constructibleΒ #170244

@halbi2

Description

@halbi2

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions