This is just a couple of minor fixes to account for the existence
of ElaboratedType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188209
91177308-0d34-0410-b5e6-
96231b3b80d8
QualType CurDeclType = getDeclType(*D);
if (!Decls.empty() && !CurDeclType.isNull()) {
QualType BaseType = GetBaseType(CurDeclType);
+ if (!BaseType.isNull() && isa<ElaboratedType>(BaseType))
+ BaseType = cast<ElaboratedType>(BaseType)->getNamedType();
if (!BaseType.isNull() && isa<TagType>(BaseType) &&
cast<TagType>(BaseType)->getDecl() == Decls[0]) {
Decls.push_back(*D);
void TypePrinter::printElaboratedBefore(const ElaboratedType *T,
raw_ostream &OS) {
+ if (Policy.SuppressTag && isa<TagType>(T->getNamedType()))
+ return;
OS << TypeWithKeyword::getKeywordName(T->getKeyword());
if (T->getKeyword() != ETK_None)
OS << " ";
__c11_atomic_load(&i, 0);
}
+
+// CHECK: void test14() {
+// CHECK: struct X {
+// CHECK: union {
+// CHECK: int x;
+// CHECK: } x;
+// CHECK: };
+// CHECK: }
+void test14() {
+ struct X { union { int x; } x; };
+}