Issue 100902
Summary [clang] NRVO used in C mode
Labels clang
Assignees
Reporter TedLyngmo
    This C program exits with `1` even though it should exit with `0`. To the best of my knowledge, NRVO is not allowed in C:
```c
typedef struct {
 int i, j;
    double a, b;
} S;

S* ptr;

S test(void) {
    S s = {0};
    ptr = &s;
    return s;
}

int main(void) {
    S t = test();
    return ptr == &t;
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to