fix another case that assumed that GetTypeForDeclarator would never return null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68918 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6c2440f..7d27617 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3623,10 +3623,8 @@
   if (II) Loc = D.getIdentifierLoc();
  
   QualType T = GetTypeForDeclarator(D, S);
-
-  if (getLangOptions().CPlusPlus) {
+  if (getLangOptions().CPlusPlus)
     CheckExtraCXXDefaultArguments(D);
-  }
 
   DiagnoseFunctionSpecifiers(D);
 
@@ -3774,8 +3772,11 @@
   // 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