Constant evaluator does not work on value-dependent or type-dependent
expressions.
Also fixed bugs uncovered by these assertions.
Paths
| Differential D61522
Added an assertion to constant evaluation enty points that prohibits dependent expressions ClosedPublic Authored by gribozavr on May 3 2019, 10:13 AM.
Details
Summary Constant evaluator does not work on value-dependent or type-dependent Also fixed bugs uncovered by these assertions.
Diff Detail
Event Timeline
Comment Actions
The bugs were detected by existing tests (those tests triggered the newly added assertions). gribozavr added inline comments.
Comment Actions The right thing to check in all of these cases should be only isValueDependent(). Every type-dependent expression should generally also be value-dependent (because the type is part of the value), but value-dependent exactly means "dependent in a way that prevents constant evaluation", so that's all that we should be checking. Comment Actions Addressed review comments:
Comment Actions
Done. PTAL.
gribozavr added inline comments.
rsmith added inline comments.
This revision is now accepted and ready to land.May 17 2019, 2:04 AM Closed by commit rL361050: Added an assertion to constant evaluation enty points that prohibits dependent… (authored by gribozavr). · Explain WhyMay 17 2019, 10:14 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 200062 cfe/trunk/lib/AST/Expr.cpp
cfe/trunk/lib/AST/ExprConstant.cpp
cfe/trunk/lib/Sema/SemaOpenMP.cpp
cfe/trunk/lib/Sema/SemaOverload.cpp
|