This is an archive of the discontinued LLVM Phabricator instance.

[Sema][SVE] Reject aligned/_Alignas for sizeless types
ClosedPublic

Authored by rsandifo-arm on Mar 3 2020, 2:40 PM.

Details

Summary

A previous patch rejected alignof for sizeless types. This patch
extends that to cover the "aligned" attribute and _Alignas. Since
sizeless types are not meant to be used for long-term data, cannot
be used in aggregates, and cannot have static storage duration,
there shouldn't be any need to fiddle with their alignment.

Like with alignof, this is a conservative position that can be
relaxed in future if it turns out to be too restrictive.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 3 2020, 2:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2020, 2:40 PM

Apply changes from git-clang-format.

LGTM

Technically, you could still do math on the address, and the difference would be visible. Granted, it's unlikely to matter in practice.

efriedma accepted this revision.Mar 11 2020, 7:16 PM
This revision is now accepted and ready to land.Mar 11 2020, 7:16 PM
This revision was automatically updated to reflect the committed changes.