]> granicus.if.org Git - clang/commit
First pass at implementing C++ enum semantics: calculate (and store) an
authorJohn McCall <rjmccall@apple.com>
Wed, 9 Dec 2009 09:09:27 +0000 (09:09 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 9 Dec 2009 09:09:27 +0000 (09:09 +0000)
commit842aef8d942a880eeb9535d40de31a86838264cb
tree389c0e27fb6c98f56bce032e96f43ba8bcd8041b
parent2f4a6b25a7409f6f05e8a5e6864de21a337c8958
First pass at implementing C++ enum semantics:  calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to.  This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/Decl.h
lib/AST/ASTContext.cpp
lib/AST/Decl.cpp
lib/Frontend/PCHReaderDecl.cpp
lib/Frontend/PCHWriterDecl.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaOverload.cpp
test/Sema/compare.c
test/SemaCXX/compare.cpp
test/SemaCXX/enum.cpp
test/SemaCXX/overload-call.cpp