} else {
RecordDecl* structDecl = DeclType->getAsRecordType()->getDecl();
- // If the record is invalid, it's members can't be trusted.
- // FIXME: I'd like to "fix" this at a higher level. That is, we should
- // never get here if the struct decl is invalid. Considering a
- // change to Type::isIncompleteType(). Until this happens, the
- // following check is certainly better than crashing.
+ // If the record is invalid, some of it's members are invalid. To avoid
+ // confusion, we forgo checking the intializer for the entire record.
if (structDecl->isInvalidDecl())
return true;
/// RecordDecl - Represents a struct/union/class. For example:
/// struct X; // Forward declaration, no "body".
/// union Y { int A, B; }; // Has body with members A and B (FieldDecls).
+/// This decl will be marked invalid if *any* members are invalid.
///
class RecordDecl : public TagDecl {
/// HasFlexibleArrayMember - This is true if this struct ends with a flexible