diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-04-12 12:21:41 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-04-12 12:21:41 +0000 |
commit | fbedb97dd2a50ec0444e2147cf5210a406e1e68f (patch) | |
tree | e837a4b2b37688d201923caf0df6b29e6888bc05 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | 0cd0fbd8c5cc008d46881a0d1f51bcbb70be0c76 (diff) | |
download | bcm5719-llvm-fbedb97dd2a50ec0444e2147cf5210a406e1e68f.tar.gz bcm5719-llvm-fbedb97dd2a50ec0444e2147cf5210a406e1e68f.zip |
Allow [[maybe_unused]] on static data members; these are considered variables and the attribute should appertain to them.
Patch by S. B. Tam.
llvm-svn: 329904
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index d4398cef881..23528f3eb28 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -2042,16 +2042,6 @@ static void handleDependencyAttr(Sema &S, Scope *Scope, Decl *D, static void handleUnusedAttr(Sema &S, Decl *D, const AttributeList &AL) { bool IsCXX17Attr = AL.isCXX11Attribute() && !AL.getScopeName(); - if (IsCXX17Attr && isa<VarDecl>(D)) { - // The C++17 spelling of this attribute cannot be applied to a static data - // member per [dcl.attr.unused]p2. - if (cast<VarDecl>(D)->isStaticDataMember()) { - S.Diag(AL.getLoc(), diag::warn_attribute_wrong_decl_type) - << AL.getName() << ExpectedForMaybeUnused; - return; - } - } - // If this is spelled as the standard C++17 attribute, but not in C++17, warn // about using it as an extension. if (!S.getLangOpts().CPlusPlus17 && IsCXX17Attr) |