aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaDecl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6c2440ff68..7d27617891 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3623,10 +3623,8 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record,
if (II) Loc = D.getIdentifierLoc();
QualType T = GetTypeForDeclarator(D, S);
-
- if (getLangOptions().CPlusPlus) {
+ if (getLangOptions().CPlusPlus)
CheckExtraCXXDefaultArguments(D);
- }
DiagnoseFunctionSpecifiers(D);
@@ -3774,8 +3772,11 @@ Sema::DeclPtrTy Sema::ActOnIvar(Scope *S,
// example, unnamed unions inject all members into the struct namespace!
QualType T = GetTypeForDeclarator(D, S);
- assert(!T.isNull() && "GetTypeForDeclarator() returned null type");
bool InvalidDecl = false;
+ if (T.isNull()) {
+ InvalidDecl = true;
+ T = Context.IntTy;
+ }
if (BitWidth) {
// 6.7.2.1p3, 6.7.2.1p4