[Sema][SVE] Reject aligned/_Alignas for sizeless types
authorRichard Sandiford <richard.sandiford@arm.com>
Mon, 2 Mar 2020 17:37:58 +0000 (17:37 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 12 Mar 2020 17:12:40 +0000 (17:12 +0000)
commit627b5c12068cc90b476a9121862a481e1d57be85
treecd5cde9f06b00b2cee347559d479f612fa8d4fe5
parent39969c7d3a6da8a60ac3ac7d10f471dea87cfca5
[Sema][SVE] Reject aligned/_Alignas for sizeless types

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.

Differential Revision: https://reviews.llvm.org/D75573
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/Sema/sizeless-1.c
clang/test/SemaCXX/sizeless-1.cpp