Issue 177084
Summary Atomic scalar types should be able to be initialized with braces
Labels new issue
Assignees
Reporter Halalaluyafail3
    The following program demonstrates the issue:
```c
int main(){
    (_Atomic int){};
}
```
Clang appears to reject initializing an atomic with a single _expression_ enclosed in braces or a C23 empty initializer. I don't see any wording that would make this invalid, and it would be very inconvenient for this to be invalid since `{}` and `{0}` are supposed to be initializers that can initialize any complete object. However, there is one scenario where Clang does allow using a C23 empty initializer with an atomic type:
```c
_Atomic int x;
int main(){}
```
This is a tentative definition, and because there are no external definitions it is as if there was a definition at the end with the composite type and an empty initializer.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to