[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-18 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Thanks! It seems like this now finally works as it should again, with the code I regularly build. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 ___

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8de51375f12d: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant… (authored by shafik). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 ___ cfe-commits mailing lis

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik updated this revision to Diff 453389. shafik marked an inline comment as done. shafik added a comment. - Added `consteval` test with default parameters CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 Files: clang/lib/AST/ExprConstant.

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik updated this revision to Diff 453350. shafik marked 2 inline comments as done. shafik added a comment. - Simplify condition to set `ConstexprVar` even more CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 Files: clang/lib/AST/ExprConst

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Precommit CI failures are unrelated to this patch. Comment at: clang/lib/AST/ExprConstant.cpp:13547-13550 + if (const auto *VD = dyn_cast_or_null(Info.EvaluatingDecl.dyn_cast())) { +if (VD && !VD->isConstexpr()) + ConstexprV

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-16 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai added a comment. I confirmed that this fixes all remaining issues on our end. Thank you! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-16 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik updated this revision to Diff 453062. shafik marked an inline comment as done. shafik added a comment. - Addressing comments on casting of `EvaluatingDecl` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131874/new/ https://reviews.llvm.org/D131874 Files: clang/lib/AST/ExprConst

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-16 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:13547-13551 + if (auto ValD = Info.EvaluatingDecl.dyn_cast()) { +const VarDecl *VD = dyn_cast_or_null(ValD); +if (VD && !VD->isConstexpr()) + NotConstexprVar = true; +

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-15 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:13547-13551 + if (auto ValD = Info.EvaluatingDecl.dyn_cast()) { +const VarDecl *VD = dyn_cast_or_null(ValD); +if (VD && !VD->isConstexpr()) + NotConstexprVar = true; + } --

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-15 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:13547-13551 + if (auto ValD = Info.EvaluatingDecl.dyn_cast()) { +const VarDecl *VD = dyn_cast_or_null(ValD); +if (VD && !VD->isConstexpr()) + NotConstexprVar = true; + } --

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-15 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik updated this revision to Diff 452775. shafik marked an inline comment as done. shafik added a comment. - Changed `NotConstexprVar` to `ConstExprVar` - Moved checking of `ConstexprVar` up so that we do the less expensive check first CHANGES SINCE LAST ACTION https://reviews.llvm.org/D13

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:13547-13551 + if (auto ValD = Info.EvaluatingDecl.dyn_cast()) { +const VarDecl *VD = dyn_cast_or_null(ValD); +if (VD && !VD->isConstexpr()) + NotConstexprVar = true; +

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-15 Thread Martin Storsjö via Phabricator via cfe-commits
mstorsjo added a comment. Thanks! With this, I think all my cases (that built before D131307 ) now build successfully again! (Can't say much about the code change itself, but I think it looks reasonable.) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D131874: [Clang] Tighten restrictions on enum out of range diagnostic to avoid constant initialization

2022-08-14 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik created this revision. shafik added reviewers: erichkeane, aaron.ballman, thakis, mstorsjo. Herald added a project: All. shafik requested review of this revision. The restrictions added in D131704 were not sufficient to avoid all non-constant expression c