Re: r257710 - [Sema] Suppress diags in overload resolution.
LGTM for 3.8. On Wed, Jan 13, 2016 at 4:03 PM, Hans Wennborgwrote: > Thanks! Richard, what say the code owner? > > On Wed, Jan 13, 2016 at 3:59 PM, George Burgess IV > wrote: >> FYI: This patch should to be merged into the clang 3.8.0 branch. >> >> Thank you! >> George >> >> On Wed, Jan 13, 2016 at 3:36 PM, George Burgess IV via cfe-commits >> wrote: >>> >>> Author: gbiv >>> Date: Wed Jan 13 17:36:34 2016 >>> New Revision: 257710 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=257710=rev >>> Log: >>> [Sema] Suppress diags in overload resolution. >>> >>> We were emitting diagnostics from our shiny new C-only overload >>> resolution mode. This patch attempts to silence all such diagnostics. >>> >>> This fixes PR26085. >>> Differential Revision: http://reviews.llvm.org/D16159 >>> >>> Added: >>> cfe/trunk/test/SemaObjC/ovl-check.m >>> Modified: >>> cfe/trunk/include/clang/Sema/Sema.h >>> cfe/trunk/lib/Sema/SemaDeclCXX.cpp >>> cfe/trunk/lib/Sema/SemaExpr.cpp >>> cfe/trunk/lib/Sema/SemaExprObjC.cpp >>> cfe/trunk/lib/Sema/SemaOverload.cpp >>> >>> Modified: cfe/trunk/include/clang/Sema/Sema.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=257710=257709=257710=diff >>> >>> == >>> --- cfe/trunk/include/clang/Sema/Sema.h (original) >>> +++ cfe/trunk/include/clang/Sema/Sema.h Wed Jan 13 17:36:34 2016 >>> @@ -2229,7 +2229,8 @@ public: >>>bool CheckPointerConversion(Expr *From, QualType ToType, >>>CastKind , >>>CXXCastPath& BasePath, >>> - bool IgnoreBaseAccess); >>> + bool IgnoreBaseAccess, >>> + bool Diagnose = true); >>>bool IsMemberPointerConversion(Expr *From, QualType FromType, QualType >>> ToType, >>> bool InOverloadResolution, >>> QualType ); >>> @@ -5388,7 +5389,8 @@ public: >>> unsigned AmbigiousBaseConvID, >>> SourceLocation Loc, SourceRange >>> Range, >>> DeclarationName Name, >>> -CXXCastPath *BasePath); >>> +CXXCastPath *BasePath, >>> +bool IgnoreAccess = false); >>> >>>std::string getAmbiguousPathsDisplayString(CXXBasePaths ); >>> >>> @@ -7514,14 +7516,15 @@ public: >>> ObjCMethodDecl *, >>> ObjCMethodDecl *, >>> TypedefNameDecl *, >>> -bool CfToNs); >>> - >>> +bool CfToNs, bool Diagnose = >>> true); >>> + >>>bool CheckObjCBridgeRelatedConversions(SourceLocation Loc, >>> QualType DestType, QualType >>> SrcType, >>> - Expr *); >>> - >>> - bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr >>> *); >>> - >>> + Expr *, bool Diagnose = >>> true); >>> + >>> + bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr >>> *, >>> + bool Diagnose = true); >>> + >>>bool checkInitMethod(ObjCMethodDecl *method, QualType >>> receiverTypeIfCall); >>> >>>/// \brief Check whether the given new method is a valid override of >>> the >>> @@ -8613,6 +8616,7 @@ public: >>>ARCConversionResult CheckObjCARCConversion(SourceRange castRange, >>> QualType castType, Expr >>> *, >>> CheckedConversionKind CCK, >>> + bool Diagnose = true, >>> bool DiagnoseCFAudited = >>> false, >>> BinaryOperatorKind Opc = >>> BO_PtrMemD >>> ); >>> >>> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp >>> URL: >>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=257710=257709=257710=diff >>> >>> == >>> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) >>> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Jan 13 17:36:34 2016 >>> @@ -1742,13 +1742,18 @@ void Sema::BuildBasePathArray(const CXXB >>> /// otherwise. Loc is the location where this routine should point to >>> /// if there is an error, and Range is the source range to highlight >>> /// if there is an error. >>> +/// >>> +/// If either InaccessibleBaseID or AmbigiousBaseConvID
Re: r257710 - [Sema] Suppress diags in overload resolution.
Thanks! r259412. On Mon, Feb 1, 2016 at 1:32 PM, Richard Smithwrote: > LGTM for 3.8. > > On Wed, Jan 13, 2016 at 4:03 PM, Hans Wennborg wrote: >> Thanks! Richard, what say the code owner? >> >> On Wed, Jan 13, 2016 at 3:59 PM, George Burgess IV >> wrote: >>> FYI: This patch should to be merged into the clang 3.8.0 branch. >>> >>> Thank you! >>> George >>> >>> On Wed, Jan 13, 2016 at 3:36 PM, George Burgess IV via cfe-commits >>> wrote: Author: gbiv Date: Wed Jan 13 17:36:34 2016 New Revision: 257710 URL: http://llvm.org/viewvc/llvm-project?rev=257710=rev Log: [Sema] Suppress diags in overload resolution. We were emitting diagnostics from our shiny new C-only overload resolution mode. This patch attempts to silence all such diagnostics. This fixes PR26085. Differential Revision: http://reviews.llvm.org/D16159 Added: cfe/trunk/test/SemaObjC/ovl-check.m Modified: cfe/trunk/include/clang/Sema/Sema.h cfe/trunk/lib/Sema/SemaDeclCXX.cpp cfe/trunk/lib/Sema/SemaExpr.cpp cfe/trunk/lib/Sema/SemaExprObjC.cpp cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/include/clang/Sema/Sema.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=257710=257709=257710=diff == --- cfe/trunk/include/clang/Sema/Sema.h (original) +++ cfe/trunk/include/clang/Sema/Sema.h Wed Jan 13 17:36:34 2016 @@ -2229,7 +2229,8 @@ public: bool CheckPointerConversion(Expr *From, QualType ToType, CastKind , CXXCastPath& BasePath, - bool IgnoreBaseAccess); + bool IgnoreBaseAccess, + bool Diagnose = true); bool IsMemberPointerConversion(Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType ); @@ -5388,7 +5389,8 @@ public: unsigned AmbigiousBaseConvID, SourceLocation Loc, SourceRange Range, DeclarationName Name, -CXXCastPath *BasePath); +CXXCastPath *BasePath, +bool IgnoreAccess = false); std::string getAmbiguousPathsDisplayString(CXXBasePaths ); @@ -7514,14 +7516,15 @@ public: ObjCMethodDecl *, ObjCMethodDecl *, TypedefNameDecl *, -bool CfToNs); - +bool CfToNs, bool Diagnose = true); + bool CheckObjCBridgeRelatedConversions(SourceLocation Loc, QualType DestType, QualType SrcType, - Expr *); - - bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr *); - + Expr *, bool Diagnose = true); + + bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr *, + bool Diagnose = true); + bool checkInitMethod(ObjCMethodDecl *method, QualType receiverTypeIfCall); /// \brief Check whether the given new method is a valid override of the @@ -8613,6 +8616,7 @@ public: ARCConversionResult CheckObjCARCConversion(SourceRange castRange, QualType castType, Expr *, CheckedConversionKind CCK, + bool Diagnose = true, bool DiagnoseCFAudited = false, BinaryOperatorKind Opc = BO_PtrMemD ); Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=257710=257709=257710=diff == --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Jan 13 17:36:34 2016 @@ -1742,13 +1742,18 @@ void Sema::BuildBasePathArray(const CXXB /// otherwise. Loc is the
Re: r257710 - [Sema] Suppress diags in overload resolution.
Thanks! Richard, what say the code owner? On Wed, Jan 13, 2016 at 3:59 PM, George Burgess IVwrote: > FYI: This patch should to be merged into the clang 3.8.0 branch. > > Thank you! > George > > On Wed, Jan 13, 2016 at 3:36 PM, George Burgess IV via cfe-commits > wrote: >> >> Author: gbiv >> Date: Wed Jan 13 17:36:34 2016 >> New Revision: 257710 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=257710=rev >> Log: >> [Sema] Suppress diags in overload resolution. >> >> We were emitting diagnostics from our shiny new C-only overload >> resolution mode. This patch attempts to silence all such diagnostics. >> >> This fixes PR26085. >> Differential Revision: http://reviews.llvm.org/D16159 >> >> Added: >> cfe/trunk/test/SemaObjC/ovl-check.m >> Modified: >> cfe/trunk/include/clang/Sema/Sema.h >> cfe/trunk/lib/Sema/SemaDeclCXX.cpp >> cfe/trunk/lib/Sema/SemaExpr.cpp >> cfe/trunk/lib/Sema/SemaExprObjC.cpp >> cfe/trunk/lib/Sema/SemaOverload.cpp >> >> Modified: cfe/trunk/include/clang/Sema/Sema.h >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=257710=257709=257710=diff >> >> == >> --- cfe/trunk/include/clang/Sema/Sema.h (original) >> +++ cfe/trunk/include/clang/Sema/Sema.h Wed Jan 13 17:36:34 2016 >> @@ -2229,7 +2229,8 @@ public: >>bool CheckPointerConversion(Expr *From, QualType ToType, >>CastKind , >>CXXCastPath& BasePath, >> - bool IgnoreBaseAccess); >> + bool IgnoreBaseAccess, >> + bool Diagnose = true); >>bool IsMemberPointerConversion(Expr *From, QualType FromType, QualType >> ToType, >> bool InOverloadResolution, >> QualType ); >> @@ -5388,7 +5389,8 @@ public: >> unsigned AmbigiousBaseConvID, >> SourceLocation Loc, SourceRange >> Range, >> DeclarationName Name, >> -CXXCastPath *BasePath); >> +CXXCastPath *BasePath, >> +bool IgnoreAccess = false); >> >>std::string getAmbiguousPathsDisplayString(CXXBasePaths ); >> >> @@ -7514,14 +7516,15 @@ public: >> ObjCMethodDecl *, >> ObjCMethodDecl *, >> TypedefNameDecl *, >> -bool CfToNs); >> - >> +bool CfToNs, bool Diagnose = >> true); >> + >>bool CheckObjCBridgeRelatedConversions(SourceLocation Loc, >> QualType DestType, QualType >> SrcType, >> - Expr *); >> - >> - bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr >> *); >> - >> + Expr *, bool Diagnose = >> true); >> + >> + bool ConversionToObjCStringLiteralCheck(QualType DstType, Expr >> *, >> + bool Diagnose = true); >> + >>bool checkInitMethod(ObjCMethodDecl *method, QualType >> receiverTypeIfCall); >> >>/// \brief Check whether the given new method is a valid override of >> the >> @@ -8613,6 +8616,7 @@ public: >>ARCConversionResult CheckObjCARCConversion(SourceRange castRange, >> QualType castType, Expr >> *, >> CheckedConversionKind CCK, >> + bool Diagnose = true, >> bool DiagnoseCFAudited = >> false, >> BinaryOperatorKind Opc = >> BO_PtrMemD >> ); >> >> Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=257710=257709=257710=diff >> >> == >> --- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original) >> +++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Jan 13 17:36:34 2016 >> @@ -1742,13 +1742,18 @@ void Sema::BuildBasePathArray(const CXXB >> /// otherwise. Loc is the location where this routine should point to >> /// if there is an error, and Range is the source range to highlight >> /// if there is an error. >> +/// >> +/// If either InaccessibleBaseID or AmbigiousBaseConvID are 0, then the >> +/// diagnostic for the respective type of error will be suppressed, but >> the >> +/// check for ill-formed code will still be performed. >> bool >>