The 'X' printf type has a valid alternative form. Fixes PR8641.

llvm-svn: 119946
This commit is contained in:
Anders Carlsson 2010-11-21 18:34:21 +00:00
parent 7fb785d449
commit a369f8dc3a
2 changed files with 7 additions and 1 deletions

View File

@ -501,10 +501,11 @@ bool PrintfSpecifier::hasValidAlternativeForm() const {
if (!HasAlternativeForm)
return true;
// Alternate form flag only valid with the oxaAeEfFgG conversions
// Alternate form flag only valid with the oxXaAeEfFgG conversions
switch (CS.getKind()) {
case ConversionSpecifier::oArg:
case ConversionSpecifier::xArg:
case ConversionSpecifier::XArg:
case ConversionSpecifier::aArg:
case ConversionSpecifier::AArg:
case ConversionSpecifier::eArg:

View File

@ -325,3 +325,8 @@ void rdar8332221(va_list ap, int *x, long *y) {
rdar8332221_vprintf_scanf("%", ap, "%d", x); // expected-warning{{incomplete format specifier}}
}
// PR8641
void pr8641() {
printf("%#x\n", 10);
printf("%#X\n", 10);
}