]> granicus.if.org Git - clang/commitdiff
After yesterday's discussion (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-Februar...
authorSteve Naroff <snaroff@apple.com>
Mon, 11 Feb 2008 21:52:37 +0000 (21:52 +0000)
committerSteve Naroff <snaroff@apple.com>
Mon, 11 Feb 2008 21:52:37 +0000 (21:52 +0000)
This commit simply changes a couple comments to reflect this decision.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46970 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp
include/clang/AST/Decl.h

index c427a81306733366d99d2f49b9cbe5850e1be3fd..aba5b421928a50e4876bed2e14999fc1f92991db 100644 (file)
@@ -527,11 +527,8 @@ bool Sema::CheckInitializerListTypes(InitListExpr*& IList, QualType &DeclType,
       } 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;
           
index 07588e4c06c312307b9bdfe52e36bcb3ca96e56a..d72a5c80fceb4260f8e646156bd49c4a4bf6b496 100644 (file)
@@ -705,6 +705,7 @@ protected:
 /// 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