Atomic qualification is not removed from cast expressions, function calls, and enumeration underlying types #96717
Labels
c23
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
C23 includes the following text that removes atomic qualification in the following contexts:
Section 6.5.5 "Cast operators" Paragraph 6 N3220
Section 6.7.3.3 "Enumeration specifiers" Paragraph 5 N3220
Section 6.7.7.4 "Function declarators" Paragraph 4 N3220
Clang does not remove atomic qualifiers in these cases, here are some examples:
This should output A, Clang outputs B.
This should be valid, Clang rejects it.
This should output A, Clang outputs B.
The case described in #96713 also has the same problem (along with the other qualifiers). Clang does remove atomic qualification in lvalue conversion since this was included in C17. GCC removes atomic qualification in all cases even in C17 mode, except for directly removing them from the function return type which is instead done when calling the function. Clang also fails to remove any qualifiers from function return types, which was reported before #39494.
The text was updated successfully, but these errors were encountered: