comparing diagnostics behavior between clang on Linux and clang on Windows in MSVC compat mode, I noticed that the deprecated copy warning (enabled via
-Wdeprecated-copy) is not raised in the latter case.
Judging by this comment in clang’s source, this is a deliberate choice, though I do not fully understand the reasoning behind it.
Can anyone shed some light here?
Good question! We hit a bug in Chromium a while ago which I think this warning would catch on Windows.
I don’t understand the comment in the code. Perhaps we should try removing the special casing for Windows and see if it breaks something?
I found the following SemaCXX test cases dealing with the deprecated copy warning (though the list may be incomplete):
None of these seem to cover the MSVC specific behavior.
I also did not find any reference to the deprecated copy warning in the compatibility related test cases (MicrosoftCompatibility.cpp), though the quirks mentioned by @tobiashieta seem to be covered there.
I submitted a patch that causes the deprecated copy warning to be also raised in MSVC compatibility mode: