Don't diagnostic atomic object access as UB in an unevaluated context
authorAaron Ballman <aaron@aaronballman.com>
Wed, 30 Mar 2022 11:12:04 +0000 (07:12 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Wed, 30 Mar 2022 11:12:49 +0000 (07:12 -0400)
commitcf4a67bcbbb109347b1e2d6cedf69bae142a182f
tree2da978a3efec8c4b7df946674a10b6a88ada4d8f
parent4a33b9ece076d85be5f73e3511f7f64269c74888
Don't diagnostic atomic object access as UB in an unevaluated context

We started diagnosing this situation with a more clear diagnostic
message, but it was pointed out that unevaluated contexts don't really
have the undefined behavior property as there is no runtime access
involved.

This augments the changes in https://reviews.llvm.org/D122656 to not
diagnose in an unevaluated context.
clang/lib/Sema/SemaExprMember.cpp
clang/test/Sema/atomic-expr.c