summaryrefslogtreecommitdiffstats
path: root/clang/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
commit2187266120ddf4204da821f553190d34a59b4748 (patch)
tree3a49f50116d4845b3c9f37761ec08236d15ae2d1 /clang/lib/Sema/SemaDeclAttr.cpp
parent945a347478b909c7805f7e157918dfc9c1b5fbad (diff)
downloadbcm5719-llvm-2187266120ddf4204da821f553190d34a59b4748.tar.gz
bcm5719-llvm-2187266120ddf4204da821f553190d34a59b4748.zip
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. llvm-svn: 107296
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 0f53fb92ef6..db128185f21 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud