languagelawyer wrote:

> Is this going to break behavior in C?

Array **prvalues** is C++11+ exclusive thing. Compound literals are lvalues in 
C https://port70.net/~nsz/c/c11/n1570.html#6.5.2.5p4
Anyway, here is a check:
```sh
$ build/bin/clang -fsyntax-only test.c
test.c:2:3: warning: expression result unused [-Wunused-value]
    2 |   *((int []){ 1, 2, 3});
      |   ^~~~~~~~~~~~~~~~~~~~~
test.c:3:24: warning: expression result unused [-Wunused-value]
    3 |   ((int []){ 1, 2, 3}) + 0;
      |   ~~~~~~~~~~~~~~~~~~~~ ^ ~
2 warnings generated.
```

https://github.com/llvm/llvm-project/pull/140702
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to