diff options
Diffstat (limited to 'include/clang/AST/EvaluatedExprVisitor.h')
-rw-r--r-- | include/clang/AST/EvaluatedExprVisitor.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/clang/AST/EvaluatedExprVisitor.h b/include/clang/AST/EvaluatedExprVisitor.h index 12c4fcc49b013..59de104b83f9b 100644 --- a/include/clang/AST/EvaluatedExprVisitor.h +++ b/include/clang/AST/EvaluatedExprVisitor.h @@ -56,6 +56,17 @@ public: return this->Visit(E->getChosenSubExpr()); } + void VisitGenericSelectionExpr(GenericSelectionExpr *E) { + // The controlling expression of a generic selection is not evaluated. + + // Don't visit either child expression if the condition is type-dependent. + if (E->isResultDependent()) + return; + // Only the selected subexpression matters; the other subexpressions and the + // controlling expression are not evaluated. + return this->Visit(E->getResultExpr()); + } + void VisitDesignatedInitExpr(DesignatedInitExpr *E) { // Only the actual initializer matters; the designators are all constant // expressions. |