]> granicus.if.org Git - clang/commitdiff
Delete dead code. (Array element types are always complete in C.)
authorEli Friedman <eli.friedman@gmail.com>
Wed, 19 Jun 2013 19:03:14 +0000 (19:03 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Wed, 19 Jun 2013 19:03:14 +0000 (19:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184332 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/Sema.cpp

index fd84b42e4f6908e5743de54970cc3eb0b1f58480..323473fe7401d27c6f3f316a584e8b1139568482 100644 (file)
@@ -4313,8 +4313,6 @@ def ext_typecheck_decl_incomplete_type : ExtWarn<
   InGroup<DiagGroup<"tentative-definition-incomplete-type">>;
 def err_tentative_def_incomplete_type : Error<
   "tentative definition has type %0 that is never completed">;
-def err_tentative_def_incomplete_type_arr : Error<
-  "tentative definition has array of type %0 that is never completed">;
 def warn_tentative_incomplete_array : Warning<
   "tentative array definition assumed to have one element">;
 def err_typecheck_incomplete_array_needs_initializer : Error<
index 4f79c938b80e920a1f7a4dc5fa88ba78115e57d2..e55524b1062cec087a82b54da6805eb5cf395f1a 100644 (file)
@@ -681,13 +681,6 @@ void Sema::ActOnEndOfTranslationUnit() {
 
     if (const IncompleteArrayType *ArrayT
         = Context.getAsIncompleteArrayType(VD->getType())) {
-      if (RequireCompleteType(VD->getLocation(),
-                              ArrayT->getElementType(),
-                              diag::err_tentative_def_incomplete_type_arr)) {
-        VD->setInvalidDecl();
-        continue;
-      }
-
       // Set the length of the array to 1 (C99 6.9.2p5).
       Diag(VD->getLocation(), diag::warn_tentative_incomplete_array);
       llvm::APInt One(Context.getTypeSize(Context.getSizeType()), true);