This is an archive of the discontinued LLVM Phabricator instance.

[ms] Give -Wmicrosoft-enum-forward-reference a chance to fire in clang-cl, PR32736
ClosedPublic

Authored by thakis on Apr 21 2017, 1:17 PM.

Details

Reviewers
hans
Summary

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.

Diff Detail

Event Timeline

thakis created this revision.Apr 21 2017, 1:17 PM
hans accepted this revision.Apr 21 2017, 1:21 PM

lgtm

This revision is now accepted and ready to land.Apr 21 2017, 1:21 PM
thakis closed this revision.Apr 21 2017, 1:25 PM

r301032, thanks.

lib/Sema/SemaDecl.cpp