[C11] Correct global atomic pointer initialization from an integer constant
authorAaron Ballman <aaron@aaronballman.com>
Sun, 2 Jul 2023 18:40:21 +0000 (14:40 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Sun, 2 Jul 2023 18:41:21 +0000 (14:41 -0400)
commit7b69eabdc18799e4a6c61b7ffff9b52d330c6ada
tree7f04849c3283365e64c8fd58c026a045c9456ba9
parent8bdcf57e60f508b11b519722ae9529a5301bb567
[C11] Correct global atomic pointer initialization from an integer constant

This is a follow-up to 2e275e24355cb224981f9beb2b026a3169fc7232 and
1395cde24b3641e284bb1daae7d56c189a2635e3 which corrects a missed case:
initializing an _Atomic(T *) from a null pointer constant in the form
of the integer literal 0.

Fixes https://github.com/llvm/llvm-project/issues/63550
Differential Revision: https://reviews.llvm.org/D154284
clang/lib/AST/ExprConstant.cpp
clang/test/CodeGen/atomic.c