// FIXME: Preserve type source info.
Result = TheSema.GetTypeFromParser(DS.getRepAsType());
assert(!Result.isNull() && "Didn't get a type for typeof?");
+ if (!Result->isDependentType())
+ if (const TagType *TT = Result->getAs<TagType>())
+ TheSema.DiagnoseUseOfDecl(TT->getDecl(),
+ DS.getTypeSpecTypeLoc());
// TypeQuals handled by caller.
Result = Context.getTypeOfType(Result);
break;
}
if (!E->isTypeDependent()) {
QualType T = E->getType();
- // FIXME. Issue warning for types built from deprecated types as well.
if (const TagType *TT = T->getAs<TagType>())
DiagnoseUseOfDecl(TT->getDecl(), E->getExprLoc());
}
enum E{ one} __attribute__((deprecated)) e; // expected-warning {{'E' is deprecated}}
typeof( e) w; // expected-warning {{'E' is deprecated}}
+
+struct foo { int x; } __attribute__((deprecated));
+typedef struct foo bar __attribute__((deprecated));
+bar x1; // expected-warning {{'bar' is deprecated}}
+
+int main() { typeof(x1) y; } // expected-warning {{'foo' is deprecated}}
+
+struct gorf { int x; };
+typedef struct gorf T __attribute__((deprecated));
+T t; // expected-warning {{'T' is deprecated}}
+void wee() { typeof(t) y; }
+
+