[PATCH] Don't trap when passing non-POD arguments to variadic functions in MS-compatibility mode

Richard Smith richard at metafoo.co.uk
Mon Sep 29 12:26:12 PDT 2014


Looks terrible, go ahead. =)

================
Comment at: lib/Sema/SemaExpr.cpp:878-879
@@ -877,3 +877,4 @@
   // emitted along with format string checking in Sema::CheckFunctionCall().
-  if (isValidVarArgType(E->getType()) == VAK_Undefined) {
+  if (isValidVarArgType(E->getType()) == VAK_Undefined &&
+      !LangOpts.MSVCCompat) {
     // Turn this into a trap.
----------------
Maybe this should be a separate `VAK_` value, `VAK_ValidInMSVC` or similar?

http://reviews.llvm.org/D5492






More information about the cfe-commits mailing list