Fix a crash on invalid with _Generic expressions
authorAaron Ballman <aaron@aaronballman.com>
Wed, 4 May 2022 16:39:18 +0000 (12:39 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 4 May 2022 16:41:56 +0000 (12:41 -0400)
commit94d36fdbd7d2c6eab250f15f65fd20a6447b92eb
tree9a6a754ac5d792a91bda2e40e18b03d7ddeff3f7
parentff8d0b338f48ab26919ac84aef2c79e1e1a20ef2
Fix a crash on invalid with _Generic expressions

We were failing to check if the controlling expression is dependent or
not when testing whether it has side effects. This would trigger an
assertion. Instead, if the controlling expression is dependent, we
suppress the check and diagnostic.

This fixes Issue 50227.
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/generic-selection.c