aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-02-11 21:52:37 +0000
committerSteve Naroff <snaroff@apple.com>2008-02-11 21:52:37 +0000
commit406db935610a6e4f41c151d85b623c43967ba422 (patch)
tree757104fbd46e0f9a830842ee4182d66d335dc17f
parente7d2211429b85d0dcee8aab271e31e8b6f150440 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46970 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Sema/SemaDecl.cpp7
-rw-r--r--include/clang/AST/Decl.h1
2 files changed, 3 insertions, 5 deletions
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index c427a81306..aba5b42192 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -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;
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 07588e4c06..d72a5c80fc 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -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