[flang-commits] [flang] [flang] Implement conditional expressions parser/semantics (F2023) (PR #186489)
Caroline Newcombe via flang-commits
flang-commits at lists.llvm.org
Fri Mar 20 13:46:01 PDT 2026
================
@@ -92,6 +92,23 @@ class IsConstantExprHelper
!sym.attrs().test(semantics::Attr::VALUE)));
}
+ template <typename T>
+ bool operator()(const ConditionalExpr<T> &conditional) const {
+ // A conditional expression is constant if all its conditions and values are
+ // constant
----------------
cenewcombe wrote:
Okay, I was thinking that `x` is a primary and not a constant, so the conditional expression is not a constant if each branch is not constant. However, the entire conditional expression is also a primary, and is a constant...it sounds like this is your reading of the standard? If so, I'll need to correct this.
https://github.com/llvm/llvm-project/pull/186489
More information about the flang-commits
mailing list