Updated to Clang 3.5a.
Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp
index 87c0a6a..6975d31 100644
--- a/lib/Lex/PPExpressions.cpp
+++ b/lib/Lex/PPExpressions.cpp
@@ -130,8 +130,9 @@
PP.LexUnexpandedNonComment(PeekTok);
if (PeekTok.isNot(tok::r_paren)) {
- PP.Diag(PeekTok.getLocation(), diag::err_pp_missing_rparen) << "defined";
- PP.Diag(LParenLoc, diag::note_matching) << "(";
+ PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_after)
+ << "'defined'" << tok::r_paren;
+ PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren;
return true;
}
// Consume the ).
@@ -257,9 +258,10 @@
// large that it is unsigned" e.g. on 12345678901234567890 where intmax_t
// is 64-bits.
if (!Literal.isUnsigned && Result.Val.isNegative()) {
- // Don't warn for a hex or octal literal: 0x8000..0 shouldn't warn.
+ // Octal, hexadecimal, and binary literals are implicitly unsigned if
+ // the value does not fit into a signed integer type.
if (ValueLive && Literal.getRadix() == 10)
- PP.Diag(PeekTok, diag::warn_integer_too_large_for_signed);
+ PP.Diag(PeekTok, diag::ext_integer_too_large_for_signed);
Result.Val.setIsUnsigned(true);
}
}
@@ -342,7 +344,7 @@
if (PeekTok.isNot(tok::r_paren)) {
PP.Diag(PeekTok.getLocation(), diag::err_pp_expected_rparen)
<< Result.getRange();
- PP.Diag(Start, diag::note_matching) << "(";
+ PP.Diag(Start, diag::note_matching) << tok::l_paren;
return true;
}
DT.State = DefinedTracker::Unknown;
@@ -680,9 +682,9 @@
case tok::question: {
// Parse the : part of the expression.
if (PeekTok.isNot(tok::colon)) {
- PP.Diag(PeekTok.getLocation(), diag::err_expected_colon)
- << LHS.getRange(), RHS.getRange();
- PP.Diag(OpLoc, diag::note_matching) << "?";
+ PP.Diag(PeekTok.getLocation(), diag::err_expected)
+ << tok::colon << LHS.getRange() << RHS.getRange();
+ PP.Diag(OpLoc, diag::note_matching) << tok::question;
return true;
}
// Consume the :.