aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-30 17:24:13 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-30 17:24:13 +0000
commit90cd672ed107d5986936c577ce47ad7374096bd2 (patch)
treeb2c4705ced11cc74a3e169a56999e8a6c2572761 /lib/Sema/SemaDeclAttr.cpp
parentf815306571385e2892e079a409f1b5b11f5e5cbb (diff)
Complain about the application of a transparent_union attribute to a
union whose first field has integral vector type. Also, clean up this diagnostic a bit. Thanks to Eli for spotting this change in semantics last week. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 0f53fb92ef..db128185f2 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1410,9 +1410,10 @@ static void HandleTransparentUnionAttr(Decl *d, const AttributeList &Attr,
FieldDecl *FirstField = *Field;
QualType FirstType = FirstField->getType();
- if (FirstType->hasFloatingRepresentation()) {
+ if (FirstType->hasFloatingRepresentation() || FirstType->isVectorType()) {
S.Diag(FirstField->getLocation(),
- diag::warn_transparent_union_attribute_floating);
+ diag::warn_transparent_union_attribute_floating)
+ << FirstType->isVectorType() << FirstType;
return;
}