[cfe-commits] r46970 - in /cfe/trunk: Sema/SemaDecl.cpp include/clang/AST/Decl.h

Steve Naroff snaroff at apple.com
Mon Feb 11 13:52:42 PST 2008


Author: snaroff
Date: Mon Feb 11 15:52:37 2008
New Revision: 46970

URL: http://llvm.org/viewvc/llvm-project?rev=46970&view=rev
Log:

After yesterday's discussion (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2008-February/001044.html), decided not to change the semantics of Type::isIncompleteType(). 

This commit simply changes a couple comments to reflect this decision.

Modified:
    cfe/trunk/Sema/SemaDecl.cpp
    cfe/trunk/include/clang/AST/Decl.h

Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=46970&r1=46969&r2=46970&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Mon Feb 11 15:52:37 2008
@@ -527,11 +527,8 @@
       } 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;
           

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=46970&r1=46969&r2=46970&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Mon Feb 11 15:52:37 2008
@@ -705,6 +705,7 @@
 /// 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





More information about the cfe-commits mailing list