aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorCorentin Jabot <corentin.jabot@gmail.com>2021-10-08 07:12:46 -0400
committerAaron Ballman <aaron@aaronballman.com>2021-10-08 07:13:45 -0400
commitff013b61004b01043bdbebb6416c30ecb3d3d48c (patch)
tree72574ea6901e6d441bf5aa4a0d5e4e57d96cd62a /clang/lib/Parse/ParseTentative.cpp
parentd68b59f3ebb253ee7119a25a71c51cf19b73e030 (diff)
downloadllvm-ff013b61004b01043bdbebb6416c30ecb3d3d48c.zip
llvm-ff013b61004b01043bdbebb6416c30ecb3d3d48c.tar.gz
llvm-ff013b61004b01043bdbebb6416c30ecb3d3d48c.tar.bz2
Extend init-statement to allow alias-declaration
Implement P2360R0 in C++23 mode and as an extension in older languages mode.
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r--clang/lib/Parse/ParseTentative.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index 73fe553..a40376d 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -483,6 +483,8 @@ Parser::isCXXConditionDeclarationOrInitStatement(bool CanBeInitStatement,
ConditionDeclarationOrInitStatementState State(*this, CanBeInitStatement,
CanBeForRangeDecl);
+ if (CanBeInitStatement && Tok.is(tok::kw_using))
+ return ConditionOrInitStatement::InitStmtDecl;
if (State.update(isCXXDeclarationSpecifier()))
return State.result();