diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 62032e8b65..9f43aa2f05 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5740,27 +5740,6 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, VDecl->setType(DclT); Init->setType(DclT); } - - - // If this variable is a local declaration with record type, make sure it - // doesn't have a flexible member initialization. We only support this as a - // global/static definition. - if (VDecl->hasLocalStorage()) - if (const RecordType *RT = VDecl->getType()->getAs<RecordType>()) - if (RT->getDecl()->hasFlexibleArrayMember()) { - // Check whether the initializer tries to initialize the flexible - // array member itself to anything other than an empty initializer list. - if (InitListExpr *ILE = dyn_cast<InitListExpr>(Init)) { - unsigned Index = std::distance(RT->getDecl()->field_begin(), - RT->getDecl()->field_end()) - 1; - if (Index < ILE->getNumInits() && - !(isa<InitListExpr>(ILE->getInit(Index)) && - cast<InitListExpr>(ILE->getInit(Index))->getNumInits() == 0)) { - Diag(VDecl->getLocation(), diag::err_nonstatic_flexible_variable); - VDecl->setInvalidDecl(); - } - } - } // Check any implicit conversions within the expression. CheckImplicitConversions(Init, VDecl->getLocation()); |