Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
Signed-off-by: Valentyn Yukhymenko <[email protected]>
  • Loading branch information
BaLiKfromUA committed May 28, 2024
1 parent 53c7d38 commit 98b0a59
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions clang/lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6751,18 +6751,17 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
DeclSpec DS(AttrFactory);

// Complain about:
// - rvalue references in C++03,
// - `^T &&` parsing ambiguity in C++2x
// - rvalue references in C++03
// - `^T &&` parsing ambiguity of compound expression with reflection in C++2x
// but then go on and build the declarator.
if (Kind == tok::ampamp) {
if (D.getContext() == DeclaratorContext::ReflectOperator) {
std::string typeName = "T";
if (D.hasName()) {
typeName = Actions.GetNameForDeclarator(D).getName().getAsString();
}
// parser already consumed '^' token before setting this context
Diag(Loc,
diag::warn_parsing_ambiguity_in_refl_expression_with_ampamp_token)
<< typeName;
<< (D.hasName()
? Actions.GetNameForDeclarator(D).getName().getAsString()
: "T");
}

Diag(Loc, getLangOpts().CPlusPlus11
Expand Down

0 comments on commit 98b0a59

Please sign in to comment.