diff options
author | Brooks Davis <brooks@FreeBSD.org> | 2014-08-01 22:38:44 +0000 |
---|---|---|
committer | Brooks Davis <brooks@FreeBSD.org> | 2014-08-01 22:38:44 +0000 |
commit | e88f73c0a6943081626839f63878969f13ae7740 (patch) | |
tree | b5ce750328b824a2f36d10be75e02169d0035ae2 /lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp | |
parent | www/py-django-datetime-widget (diff) |
Add ports of LLVM and Clang 3.5rc1.
In the LLVM port the option to build cmake support files is disabled by
default because it fails to configure when built with gcc47.
The Clang port is marked broken if the compiler isn't clang due to link
errors when it is gcc47.
Diffstat (limited to 'lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp')
-rw-r--r-- | lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp b/lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp new file mode 100644 index 000000000000..139b7df86124 --- /dev/null +++ b/lang/clang35/files/patch-tools_clang_lib_Sema_SemaChecking.cpp @@ -0,0 +1,45 @@ + +$FreeBSD$ + +--- tools/clang/lib/Sema/SemaChecking.cpp.orig ++++ tools/clang/lib/Sema/SemaChecking.cpp +@@ -1511,6 +1511,39 @@ + CoveredArgs.set(argIndex); + } + ++ // FreeBSD extensions ++ if (CS.getKind() == ConversionSpecifier::bArg || CS.getKind() == ConversionSpecifier::DArg) { ++ // claim the second argument ++ CoveredArgs.set(argIndex + 1); ++ ++ // Now type check the data expression that matches the ++ // format specifier. ++ const Expr *Ex = getDataArg(argIndex); ++ QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy); ++ //const analyze_printf::ArgType &ATR = S.Context.IntTy; ++ const analyze_printf::ArgType &ATR = type; ++ if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) ++ S.Diag(getLocationOfByte(CS.getStart()), ++ diag::warn_format_conversion_argument_type_mismatch) ++ << ATR.getRepresentativeType(S.Context) << Ex->getType() ++ << getSpecifierRange(startSpecifier, specifierLen) ++ << Ex->getSourceRange(); ++ ++ // Now type check the data expression that matches the ++ // format specifier. ++ Ex = getDataArg(argIndex + 1); ++ const analyze_printf::ArgType &ATR2 = ArgType::CStrTy; ++ if (ATR2.isValid() && !ATR2.matchesType(S.Context, Ex->getType())) ++ S.Diag(getLocationOfByte(CS.getStart()), ++ diag::warn_format_conversion_argument_type_mismatch) ++ << ATR2.getRepresentativeType(S.Context) << Ex->getType() ++ << getSpecifierRange(startSpecifier, specifierLen) ++ << Ex->getSourceRange(); ++ ++ return true; ++ } ++ // END OF FREEBSD EXTENSIONS ++ + // Check for using an Objective-C specific conversion specifier + // in a non-ObjC literal. + if (!IsObjCLiteral && CS.isObjCArg()) { |