diff options
author | Corentin Jabot <corentinjabot@gmail.com> | 2023-07-05 12:54:01 +0200 |
---|---|---|
committer | Corentin Jabot <corentinjabot@gmail.com> | 2023-07-05 16:20:53 +0200 |
commit | 1077a343911127452615c6f5441c121de06be6d5 (patch) | |
tree | 5d394d3bd0df5c75b6e3d7cb7561651f31402182 /clang/lib/Parse/ParseStmt.cpp | |
parent | 4488ee259064532dda24024a7e96037fe9a3c0d9 (diff) | |
download | llvm-1077a343911127452615c6f5441c121de06be6d5.zip llvm-1077a343911127452615c6f5441c121de06be6d5.tar.gz llvm-1077a343911127452615c6f5441c121de06be6d5.tar.bz2 |
[Clang] Fix handling of using declarations in for loop init statements.
The type was never saved, and therefore never transformed
in dependent contexts.
Reviewed By: aaron.ballman, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D154492
Diffstat (limited to 'clang/lib/Parse/ParseStmt.cpp')
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 43ff808..2346470 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -2054,15 +2054,15 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) { Diag(Tok, diag::warn_gcc_variable_decl_in_for_loop); } DeclGroupPtrTy DG; + SourceLocation DeclStart = Tok.getLocation(), DeclEnd; if (Tok.is(tok::kw_using)) { DG = ParseAliasDeclarationInInitStatement(DeclaratorContext::ForInit, attrs); + FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation()); } else { // In C++0x, "for (T NS:a" might not be a typo for :: bool MightBeForRangeStmt = getLangOpts().CPlusPlus; ColonProtectionRAIIObject ColonProtection(*this, MightBeForRangeStmt); - - SourceLocation DeclStart = Tok.getLocation(), DeclEnd; ParsedAttributes DeclSpecAttrs(AttrFactory); DG = ParseSimpleDeclaration( DeclaratorContext::ForInit, DeclEnd, attrs, DeclSpecAttrs, false, |