MS format strings: allow the 'h' length modifier with C, C, s and S (PR20808)

llvm-svn: 217196
This commit is contained in:
Hans Wennborg
2014-09-04 21:39:52 +00:00
parent 68f42b9515
commit 1b23158ce4
4 changed files with 42 additions and 2 deletions

View File

@@ -612,8 +612,20 @@ bool FormatSpecifier::hasValidLengthModifier(const TargetInfo &Target) const {
return true;
// Handle most integer flags
case LengthModifier::AsChar:
case LengthModifier::AsShort:
if (Target.getTriple().isOSMSVCRT()) {
switch (CS.getKind()) {
case ConversionSpecifier::cArg:
case ConversionSpecifier::CArg:
case ConversionSpecifier::sArg:
case ConversionSpecifier::SArg:
return true;
default:
break;
}
}
// Fall through.
case LengthModifier::AsChar:
case LengthModifier::AsLongLong:
case LengthModifier::AsQuad:
case LengthModifier::AsIntMax: