Check whether the destination is a complete type in a static_cast (or
authorRichard Smith <richard@metafoo.co.uk>
Tue, 17 Dec 2019 02:26:19 +0000 (18:26 -0800)
committerRichard Smith <richard@metafoo.co.uk>
Tue, 17 Dec 2019 02:33:35 +0000 (18:33 -0800)
commiteea8ba097c4a86632b88291bea51eb710f8ae4fb
treee13d3795d4009530dad4bfae7228b6c327097f11
parentce12a523b0e1a64cea63ba099642d7f3492a3791
Check whether the destination is a complete type in a static_cast (or
C-style cast) to an enumeration type.

We previously forgot to check this, and happened to get away with it
(with bad diagnostics) only because we misclassified incomplete
enumeration types as not being unscoped enumeration types. This also
fixes the misclassification.
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/AST/Type.cpp
clang/lib/Sema/SemaCast.cpp
clang/test/SemaCXX/enum.cpp