]> granicus.if.org Git - clang/commit
[Sema] Don't permit dependent alignments on non-dependent typedef-names
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 7 Apr 2015 02:37:09 +0000 (02:37 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 7 Apr 2015 02:37:09 +0000 (02:37 +0000)
commitbd329541bee4decfa9a632abad77b87f1cf153e4
tree945958533df6809e20f928a998d300801ba7ddbe
parent4fffea95fd05616d2c225ee7fb80aee2309fbc53
[Sema] Don't permit dependent alignments on non-dependent typedef-names

A dependent alignment attribute (like __attribute__((aligned(...))) or
__declspec(align(...))) on a non-dependent typedef or using declaration
poses a considerable challenge: the type is _not_ dependent, the size
_may_ be dependent if the type is used as an array type, the alignment
_is_ dependent.

It is reasonable for a compiler to be able to query the size and
alignment of a complete type.  Let's help that become an invariant.

This fixes PR22042.

Differential Revision: http://reviews.llvm.org/D8693

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234280 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
test/SemaCXX/alignof.cpp