@@ -637,11 +637,11 @@ ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc,
637637 }
638638
639639 InitializationSequence InitSeq (SemaRef, Entity, Kind, SubInit);
640- // libstdc++4.6 marks the vector default constructor as explicit in
641- // _GLIBCXX_DEBUG mode, so recover using the C++03 logic in that case.
642- // stlport does so too. Look for std::__debug for libstdc++, and for
643- // std:: for stlport. This is effectively a compiler-side implementation of
644- // LWG2193.
640+ // HACK: libstdc++ prior to 4.9 marks the vector default constructor
641+ // as explicit in _GLIBCXX_DEBUG mode, so recover using the C++03 logic
642+ // in that case. stlport does so too.
643+ // Look for std::__debug for libstdc++, and for std:: for stlport.
644+ // This is effectively a compiler-side implementation of LWG2193.
645645 if (!InitSeq && EmptyInitList && InitSeq.getFailureKind () ==
646646 InitializationSequence::FK_ExplicitConstructor) {
647647 OverloadCandidateSet::iterator Best;
@@ -6240,24 +6240,6 @@ static void TryUserDefinedConversion(Sema &S,
62406240 }
62416241}
62426242
6243- // / An egregious hack for compatibility with libstdc++-4.2: in <tr1/hashtable>,
6244- // / a function with a pointer return type contains a 'return false;' statement.
6245- // / In C++11, 'false' is not a null pointer, so this breaks the build of any
6246- // / code using that header.
6247- // /
6248- // / Work around this by treating 'return false;' as zero-initializing the result
6249- // / if it's used in a pointer-returning function in a system header.
6250- static bool isLibstdcxxPointerReturnFalseHack (Sema &S,
6251- const InitializedEntity &Entity,
6252- const Expr *Init) {
6253- return S.getLangOpts ().CPlusPlus11 &&
6254- Entity.getKind () == InitializedEntity::EK_Result &&
6255- Entity.getType ()->isPointerType () &&
6256- isa<CXXBoolLiteralExpr>(Init) &&
6257- !cast<CXXBoolLiteralExpr>(Init)->getValue () &&
6258- S.getSourceManager ().isInSystemHeader (Init->getExprLoc ());
6259- }
6260-
62616243// / The non-zero enum values here are indexes into diagnostic alternatives.
62626244enum InvalidICRKind { IIK_okay, IIK_nonlocal, IIK_nonscalar };
62636245
@@ -6943,12 +6925,10 @@ void InitializationSequence::InitializeFrom(Sema &S,
69436925
69446926 AddPassByIndirectCopyRestoreStep (DestType, ShouldCopy);
69456927 } else if (ICS.isBad ()) {
6946- if (isLibstdcxxPointerReturnFalseHack (S, Entity, Initializer))
6947- AddZeroInitializationStep (Entity.getType ());
6948- else if (DeclAccessPair Found;
6949- Initializer->getType () == Context.OverloadTy &&
6950- !S.ResolveAddressOfOverloadedFunction (Initializer, DestType,
6951- /* Complain=*/ false , Found))
6928+ if (DeclAccessPair Found;
6929+ Initializer->getType () == Context.OverloadTy &&
6930+ !S.ResolveAddressOfOverloadedFunction (Initializer, DestType,
6931+ /* Complain=*/ false , Found))
69526932 SetFailed (InitializationSequence::FK_AddressOfOverloadFailed);
69536933 else if (Initializer->getType ()->isFunctionType () &&
69546934 isExprAnUnaddressableFunction (S, Initializer))
0 commit comments