gcc/testsuite/g++.dg/tree-ssa/value-expr2.C
raw| 1 | // PR c++/107504 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | // { dg-additional-options -fdump-tree-gimple-lineno } |
| 4 | // { dg-final { scan-tree-dump-not {value-expr: \[} "gimple" } } |
| 5 | |
| 6 | struct S |
| 7 | { |
| 8 | void* i; |
| 9 | int j; |
| 10 | }; |
| 11 | |
| 12 | S f(char* p) |
| 13 | { |
| 14 | return {p, 1}; |
| 15 | } |
| 16 | |
| 17 | int main() |
| 18 | { |
| 19 | char buf[1]; |
| 20 | auto [x, y] = f(buf); |
| 21 | if (x != buf) |
| 22 | throw 1; |
| 23 | if (y != 1) |
| 24 | throw 2; |
| 25 | return 0; |
| 26 | } |