From: Eli Friedman Date: Wed, 19 Jun 2013 19:03:14 +0000 (+0000) Subject: Delete dead code. (Array element types are always complete in C.) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=08dc71f4f2a75fd9869ee91b12f36695b700adfc;p=clang Delete dead code. (Array element types are always complete in C.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184332 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index fd84b42e4f..323473fe74 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -4313,8 +4313,6 @@ def ext_typecheck_decl_incomplete_type : ExtWarn< InGroup>; 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< diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 4f79c938b8..e55524b106 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -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);