[clang] [Clang][Sema][OpenMP] Allow `num_teams` to accept multiple expressions (PR #99732)
Johannes Doerfert via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 5 00:15:48 PDT 2024
================
@@ -11357,8 +11358,13 @@ void OMPClauseReader::VisitOMPAllocateClause(OMPAllocateClause *C) {
void OMPClauseReader::VisitOMPNumTeamsClause(OMPNumTeamsClause *C) {
VisitOMPClauseWithPreInit(C);
- C->setNumTeams(Record.readSubExpr());
C->setLParenLoc(Record.readSourceLocation());
+ unsigned NumVars = C->varlist_size();
+ SmallVector<Expr *, 16> Vars;
+ Vars.reserve(NumVars);
+ for ([[maybe_unused]] unsigned I : llvm::seq<unsigned>(NumVars))
----------------
jdoerfert wrote:
Looks to me like it works fine in C++:
https://cxx.godbolt.org/z/7W5zxs1ME
https://github.com/llvm/llvm-project/pull/99732
More information about the cfe-commits
mailing list