invalid Assert in Lex/LiteralSupport.cpp?

CharLiteralParser::CharLiteralParser(const char *begin, const char *end,

SourceLocation Loc, Preprocessor &PP) {

// At this point we know that the character matches the regex “L?’.*’”.

….

// FIXME: This assumes that ‘int’ is 32-bits in overflow calculation, and the

// size of “value”.

assert(PP.getTargetInfo().getIntWidth() == 32 &&

“Assumes sizeof(int) == 4 for now”);

For PIC16, “int” is 16.

Should this assert be rather

assert(PP.getTargetInfo().getIntWidth() <= 32 &&

“Assumes sizeof(int) <= 4 for now”);

  • Sanjiv

Have you audited the code to ensure it will behave correctly with those assumptions?

-Chris

Yes, and that change works too.

  • Sanjiv

I responded on cfe-commits, but this change is not correct without other changes to that function.

-Chris