r244650 - [MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 11 12:25:13 PDT 2015


Author: majnemer
Date: Tue Aug 11 14:25:13 2015
New Revision: 244650

URL: http://llvm.org/viewvc/llvm-project?rev=244650&view=rev
Log:
[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError

This non-conforming extension was introduced to make it possible for us
to correctly compile <atomic> in VS 2013 and 2015.  Let's limit its
impact to system headers to encourage portable code.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=244650&r1=244649&r2=244650&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Aug 11 14:25:13 2015
@@ -5436,7 +5436,7 @@ def ext_cast_fn_obj : Extension<
 def ext_ms_cast_fn_obj : ExtWarn<
   "static_cast between pointer-to-function and pointer-to-object is a "
   "Microsoft extension">,
-  InGroup<MicrosoftCast>;
+  InGroup<MicrosoftCast>, DefaultError, SFINAEFailure;
 def warn_cxx98_compat_cast_fn_obj : Warning<
   "cast between pointer-to-function and pointer-to-object is incompatible with C++98">,
   InGroup<CXX98CompatPedantic>, DefaultIgnore;

Modified: cfe/trunk/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp?rev=244650&r1=244649&r2=244650&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp (original)
+++ cfe/trunk/test/SemaCXX/MicrosoftCompatibility-cxx98.cpp Tue Aug 11 14:25:13 2015
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++98 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions
+// RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -std=c++98 -Wmicrosoft -verify -fms-compatibility -fexceptions -fcxx-exceptions -Wno-error=microsoft-cast
 
 
 //MSVC allows forward enum declaration




More information about the cfe-commits mailing list