]> granicus.if.org Git - clang/commit
Create a new 'flag_enum' attribute.
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Fri, 28 Nov 2014 00:53:20 +0000 (00:53 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Fri, 28 Nov 2014 00:53:20 +0000 (00:53 +0000)
commit672481705244a63e11014dbee86820323c2b3896
tree15c72932e7250be6ecf5cc0712a8999dc4f07d88
parent5609bba46f1f7da78b097298970cd2c0378aad6b
Create a new 'flag_enum' attribute.

This attribute serves as a hint to improve warnings about the ranges of
enumerators used as flag types. It currently has no working C++ implementation
due to different semantics for enums in C++. For more explanation, see the docs
and testcases.

Reviewed by Aaron Ballman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222906 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/AttributeList.h
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaStmt.cpp
test/Sema/attr-flag-enum.c [new file with mode: 0644]
test/SemaCXX/attr-flag-enum-reject.cpp [new file with mode: 0644]
utils/TableGen/ClangAttrEmitter.cpp