[PATCH] D125349: [Sema] Fix crash for C11 atomic in gnu++ mode
Jan Korous via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 18 15:29:40 PDT 2022
jkorous added a comment.
In D125349#3509546 <https://reviews.llvm.org/D125349#3509546>, @ahatanak wrote:
> Is it not possible to handle this similarly to `volatile unsigned`? If I replace `_Atomic unsigned` with `volatile unsigned`, I see `LookupOverloadedBinOp` succeed without having to strip volatile because `addAssignmentArithmeticOverloads` adds candidates with volatile types.
Possibly? I am just generally apprehensive about changing the C++ side of things as I can't imagine all the consequences.
One difference that I see is the existence of `volatile`-qualified versions of these operators being prescribed by C++ standard while the operators you suggest definitely aren't:
// C++ [over.built]p18:
//
// For every triple (L, VQ, R), where L is an arithmetic type,
// VQ is either volatile or empty, and R is a promoted
// arithmetic type, there exist candidate operator functions of
// the form
https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaOverload.cpp#L8926
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125349/new/
https://reviews.llvm.org/D125349
More information about the cfe-commits
mailing list