diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 19:17:14 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-06-10 19:17:14 +0000 | 
| commit | db17bf38c59bc172953ed66cfe1b10c03c6bc383 (patch) | |
| tree | 2712281fec99b99c2fcafd5b46439dfdd93261aa /contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp | |
| parent | 686fb94a00297bf9ff49d93b948925552a2ce8e0 (diff) | |
| parent | 7ab83427af0f77b59941ceba41d509d7d097b065 (diff) | |
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp')
| -rw-r--r-- | contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp | 18 | 
1 files changed, 11 insertions, 7 deletions
| diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp index a05f7a7e406b..00a4b39f1423 100644 --- a/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp @@ -2658,6 +2658,8 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,          Context, GlobalCtx, SourceLocation(), SourceLocation(), Name,          FnType, /*TInfo=*/nullptr, SC_None, false, true);      Alloc->setImplicit(); +    // Global allocation functions should always be visible. +    Alloc->setHidden(false);      // Implicit sized deallocation functions always have default visibility.      Alloc->addAttr( @@ -5104,7 +5106,9 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,        return QualType();      // Cast LHS to type of use. -    QualType UseType = isIndirect ? Context.getPointerType(Class) : Class; +    QualType UseType = Context.getQualifiedType(Class, LHSType.getQualifiers()); +    if (isIndirect) +      UseType = Context.getPointerType(UseType);      ExprValueKind VK = isIndirect ? VK_RValue : LHS.get()->getValueKind();      LHS = ImpCastExprToType(LHS.get(), UseType, CK_DerivedToBase, VK,                              &BasePath); @@ -5281,16 +5285,16 @@ static bool FindConditionalOverload(Sema &Self, ExprResult &LHS, ExprResult &RHS    switch (CandidateSet.BestViableFunction(Self, QuestionLoc, Best)) {      case OR_Success: {        // We found a match. Perform the conversions on the arguments and move on. -      ExprResult LHSRes = -        Self.PerformImplicitConversion(LHS.get(), Best->BuiltinTypes.ParamTypes[0], -                                       Best->Conversions[0], Sema::AA_Converting); +      ExprResult LHSRes = Self.PerformImplicitConversion( +          LHS.get(), Best->BuiltinParamTypes[0], Best->Conversions[0], +          Sema::AA_Converting);        if (LHSRes.isInvalid())          break;        LHS = LHSRes; -      ExprResult RHSRes = -        Self.PerformImplicitConversion(RHS.get(), Best->BuiltinTypes.ParamTypes[1], -                                       Best->Conversions[1], Sema::AA_Converting); +      ExprResult RHSRes = Self.PerformImplicitConversion( +          RHS.get(), Best->BuiltinParamTypes[1], Best->Conversions[1], +          Sema::AA_Converting);        if (RHSRes.isInvalid())          break;        RHS = RHSRes; | 
