@@ -637,11 +637,11 @@ ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc,
637
637
}
638
638
639
639
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.
645
645
if (!InitSeq && EmptyInitList && InitSeq.getFailureKind () ==
646
646
InitializationSequence::FK_ExplicitConstructor) {
647
647
OverloadCandidateSet::iterator Best;
@@ -6240,24 +6240,6 @@ static void TryUserDefinedConversion(Sema &S,
6240
6240
}
6241
6241
}
6242
6242
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
-
6261
6243
// / The non-zero enum values here are indexes into diagnostic alternatives.
6262
6244
enum InvalidICRKind { IIK_okay, IIK_nonlocal, IIK_nonscalar };
6263
6245
@@ -6943,12 +6925,10 @@ void InitializationSequence::InitializeFrom(Sema &S,
6943
6925
6944
6926
AddPassByIndirectCopyRestoreStep (DestType, ShouldCopy);
6945
6927
} 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))
6952
6932
SetFailed (InitializationSequence::FK_AddressOfOverloadFailed);
6953
6933
else if (Initializer->getType ()->isFunctionType () &&
6954
6934
isExprAnUnaddressableFunction (S, Initializer))
0 commit comments