]> granicus.if.org Git - clang/commitdiff
[MSVC Compatibility] Classify ext_ms_cast_fn_obj as DefaultError
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 11 Aug 2015 19:25:13 +0000 (19:25 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 11 Aug 2015 19:25:13 +0000 (19:25 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244650 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaCXX/MicrosoftCompatibility-cxx98.cpp

index 2afcb76874584583ef538ad21084a2143ae294c9..b672394c4f6a11bb440d03c12ccf5b8f020f0023 100644 (file)
@@ -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;
index bfda837e9590b06d043e9dfc4ec716601f95576c..626381b35a2cd6a7adc2d3f0ab2d1cbf593099d0 100644 (file)
@@ -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