diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 672e487a34f..7e827834047 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -39,7 +39,7 @@ using namespace clang; /// referenced), false otherwise. bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { // See if the decl is deprecated. - if (D->getAttr<DeprecatedAttr>()) { + if (D->getAttr<DeprecatedAttr>(Context)) { // Implementing deprecated stuff requires referencing deprecated // stuff. Don't warn if we are implementing a deprecated // construct. @@ -48,7 +48,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { if (NamedDecl *ND = getCurFunctionOrMethodDecl()) { // If this reference happens *in* a deprecated function or method, don't // warn. - isSilenced = ND->getAttr<DeprecatedAttr>(); + isSilenced = ND->getAttr<DeprecatedAttr>(Context); // If this is an Objective-C method implementation, check to see if the // method was deprecated on the declaration, not the definition. @@ -61,7 +61,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { MD = Impl->getClassInterface()->getMethod(Context, MD->getSelector(), MD->isInstanceMethod()); - isSilenced |= MD && MD->getAttr<DeprecatedAttr>(); + isSilenced |= MD && MD->getAttr<DeprecatedAttr>(Context); } } } @@ -80,7 +80,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { } // See if the decl is unavailable - if (D->getAttr<UnavailableAttr>()) { + if (D->getAttr<UnavailableAttr>(Context)) { Diag(Loc, diag::warn_unavailable) << D->getDeclName(); Diag(D->getLocation(), diag::note_unavailable_here) << 0; } @@ -95,7 +95,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) { void Sema::DiagnoseSentinelCalls(NamedDecl *D, SourceLocation Loc, Expr **Args, unsigned NumArgs) { - const SentinelAttr *attr = D->getAttr<SentinelAttr>(); + const SentinelAttr *attr = D->getAttr<SentinelAttr>(Context); if (!attr) return; int sentinelPos = attr->getSentinel(); @@ -1127,7 +1127,7 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc, if (CurBlock && ShouldSnapshotBlockValueReference(CurBlock, VD)) { QualType ExprTy = VD->getType().getNonReferenceType(); // The BlocksAttr indicates the variable is bound by-reference. - if (VD->getAttr<BlocksAttr>()) + if (VD->getAttr<BlocksAttr>(Context)) return Owned(new (Context) BlockDeclRefExpr(VD, ExprTy, Loc, true)); // Variable will be bound by-copy, make it const within the closure. @@ -3408,7 +3408,7 @@ Sema::CheckTransparentUnionArgumentConstraints(QualType ArgType, Expr *&rExpr) { // If the ArgType is a Union type, we want to handle a potential // transparent_union GCC extension. const RecordType *UT = ArgType->getAsUnionType(); - if (!UT || !UT->getDecl()->hasAttr<TransparentUnionAttr>()) + if (!UT || !UT->getDecl()->hasAttr<TransparentUnionAttr>(Context)) return Incompatible; // The field to initialize within the transparent union. @@ -5142,7 +5142,7 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { CurBlock->hasPrototype = true; CurBlock->isVariadic = false; // Check for a valid sentinel attribute on this block. - if (CurBlock->TheDecl->getAttr<SentinelAttr>()) { + if (CurBlock->TheDecl->getAttr<SentinelAttr>(Context)) { Diag(ParamInfo.getAttributes()->getLoc(), diag::warn_attribute_sentinel_not_variadic) << 1; // FIXME: remove the attribute. @@ -5190,7 +5190,8 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { PushOnScopeChains(*AI, CurBlock->TheScope); // Check for a valid sentinel attribute on this block. - if (!CurBlock->isVariadic && CurBlock->TheDecl->getAttr<SentinelAttr>()) { + if (!CurBlock->isVariadic && + CurBlock->TheDecl->getAttr<SentinelAttr>(Context)) { Diag(ParamInfo.getAttributes()->getLoc(), diag::warn_attribute_sentinel_not_variadic) << 1; // FIXME: remove the attribute. |