Skip to content

Commit db1ad53

Browse files
Merge branch 'refl-parse' of https://github.com/changkhothuychung/llvm-project into refl-parse
2 parents 96280f7 + 99950d7 commit db1ad53

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@ def err_placeholder_expected_auto_or_decltype_auto : Error<
18511851
"expected 'auto' or 'decltype(auto)' after concept name">;
18521852
}
18531853

1854-
let CategoryName = "Reflection Issue" in {
1854+
let CategoryName = "Reflection Diagnostics" in {
18551855
def err_cannot_reflect_operand : Error<
18561856
"expected reflectable entity">;
18571857
}

clang/lib/Basic/OperatorPrecedence.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ prec::Level getBinOpPrecedence(tok::TokenKind Kind, bool GreaterThanIsOperator,
5454
case tok::pipepipe: return prec::LogicalOr;
5555
case tok::ampamp: return prec::LogicalAnd;
5656
case tok::pipe: return prec::InclusiveOr;
57+
// this is for the case when ^^ appears where a binary operator is needed,
58+
// and the first ^ is the actual binary operator,
59+
// and the second is for a block.
5760
case tok::caretcaret:
5861
case tok::caret: return prec::ExclusiveOr;
5962
case tok::amp: return prec::And;

clang/lib/Parse/ParseExpr.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,10 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
333333
Token OpToken = Tok;
334334
ConsumeToken();
335335

336-
// the reflection operator can't be in a binary expression
337-
// so if reflection and blocks are enabled, we need to
338-
// split caretcaret into two caret's
336+
// The reflection operator is not valid here (i.e., in the place of the
337+
// operator token in a binary expression), so if reflection and blocks are
338+
// enabled, we split caretcaret into two carets: the first being the binary
339+
// operator and the second being the introducer for the block.
339340
if (OpToken.is(tok::caretcaret)) {
340341
assert(getLangOpts().Reflection &&
341342
"reflection support disabled - compile with -freflection");

0 commit comments

Comments
 (0)