diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-13 22:07:09 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-08-13 22:07:09 +0000 |
commit | f79178635abeec3bf958a08eb760d6db911ee3c1 (patch) | |
tree | c9cf488faba0e90cec9623aefe73c907dff70aad /clang/lib/Sema/SemaDecl.cpp | |
parent | cade635c77004ddfabe97a0bbefefcf90d322ed8 (diff) | |
download | bcm5719-llvm-f79178635abeec3bf958a08eb760d6db911ee3c1.tar.gz bcm5719-llvm-f79178635abeec3bf958a08eb760d6db911ee3c1.zip |
Model type attributes as regular Attrs.
Specifically, AttributedType now tracks a regular attr::Kind rather than
having its own parallel Kind enumeration, and AttributedTypeLoc now
holds an Attr* instead of holding an ad-hoc collection of Attr fields.
Differential Revision: https://reviews.llvm.org/D50526
llvm-svn: 339623
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index abdeba60be7..e62728c124c 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5999,14 +5999,14 @@ static void checkAttributesAfterMerging(Sema &S, NamedDecl &ND) { // The [[lifetimebound]] attribute can be applied to the implicit object // parameter of a non-static member function (other than a ctor or dtor) // by applying it to the function type. - if (ATL.getAttrKind() == AttributedType::attr_lifetimebound) { + if (const auto *A = ATL.getAttrAs<LifetimeBoundAttr>()) { const auto *MD = dyn_cast<CXXMethodDecl>(FD); if (!MD || MD->isStatic()) { - S.Diag(ATL.getAttrNameLoc(), diag::err_lifetimebound_no_object_param) - << !MD << ATL.getLocalSourceRange(); + S.Diag(A->getLocation(), diag::err_lifetimebound_no_object_param) + << !MD << A->getRange(); } else if (isa<CXXConstructorDecl>(MD) || isa<CXXDestructorDecl>(MD)) { - S.Diag(ATL.getAttrNameLoc(), diag::err_lifetimebound_ctor_dtor) - << isa<CXXDestructorDecl>(MD) << ATL.getLocalSourceRange(); + S.Diag(A->getLocation(), diag::err_lifetimebound_ctor_dtor) + << isa<CXXDestructorDecl>(MD) << A->getRange(); } } } |