]> granicus.if.org Git - clang/commit
[ms] Give -Wmicrosoft-enum-forward-reference a chance to fire in clang-cl, PR32736
authorNico Weber <nicolasweber@gmx.de>
Fri, 21 Apr 2017 20:12:26 +0000 (20:12 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 21 Apr 2017 20:12:26 +0000 (20:12 +0000)
commit0832a0080cbfcb2f5c98b5312d60108908c33104
tree3d4cf37427c4399cd34d8fd0b8feb7e8de20556e
parentd10c298f0fbab013ff45d395a3de8aa14085ccae
[ms] Give -Wmicrosoft-enum-forward-reference a chance to fire in clang-cl, PR32736

clang-cl sets MicrosoftCompat. In that mode, we always give enums a fixed
underlying type, and for enums with fixed underlying type we never enter the
block that tries to emit ext_ms_forward_ref_enum. Fix this by requiring an
explicit underlying type when we're skipping this diagnostic.

We had a test for this warning, but it only ran in C++98 mode. clang-cl always
enables -std=c++14, so MicrosoftCompatibiliy-cxx98.cpp is a fairly useless
test. Fold it into MicrosoftCompatibility.cpp -- that way, the test checks if
-Wmicrosoft-enum-forward-reference can fire in clang-cl builds.

https://reviews.llvm.org/D32369

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@301032 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/SemaCXX/MicrosoftCompatibility-cxx98.cpp [deleted file]
test/SemaCXX/MicrosoftCompatibility.cpp