summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2014-09-29 23:06:57 +0000
committerHans Wennborg <hans@hanshq.net>2014-09-29 23:06:57 +0000
commitd9dd4d29b7dee9035f1379af467f3366c4ca0bd1 (patch)
tree8baae709e9767945dee708c6a119f06f26c9de18 /clang/lib/Sema/SemaChecking.cpp
parentb166d45730e1d32bca8c03482034222c42314693 (diff)
downloadbcm5719-llvm-d9dd4d29b7dee9035f1379af467f3366c4ca0bd1.tar.gz
bcm5719-llvm-d9dd4d29b7dee9035f1379af467f3366c4ca0bd1.zip
Don't trap when passing non-POD arguments to variadic functions in MS-compatibility mode
Clang warns (treated as error by default, but still ignored in system headers) when passing non-POD arguments to variadic functions, and generates a trap instruction to crash the program if that code is ever run. Unfortunately, MSVC happily generates code for such calls without a warning, and there is code in system headers that use it. This makes Clang not insert the trap instruction when in -fms-compatibility mode, while still generating the warning/error message. Differential Revision: http://reviews.llvm.org/D5492 llvm-svn: 218640
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 2cf25feae2e..b4f90d3b4f6 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -3569,6 +3569,7 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
break;
case Sema::VAK_Undefined:
+ case Sema::VAK_MSVCUndefined:
EmitFormatDiagnostic(
S.PDiag(diag::warn_non_pod_vararg_with_format_string)
<< S.getLangOpts().CPlusPlus11
OpenPOWER on IntegriCloud