1 // RUN: %clang_cc1 -verify=wrong -std=c99 %s
2 // RUN: %clang_cc1 -verify=wrong -std=c11 %s
3 // RUN: %clang_cc1 -verify=cpp -std=c++11 -x c++ %s
6 * Extending the lifetime of temporary objects (factored approach)
8 * NB: we do not properly materialize temporary expressions in situations where
9 * it would be expected; that is why the "no-diagnostics" marking is named
10 * "wrong". We do issue the expected diagnostic in C++ mode.
13 // wrong-no-diagnostics
15 struct X
{ int a
[5]; };
19 // FIXME: This diagnostic should be issued in C11 as well (though not in C99,
20 // as this paper was a breaking change between C99 and C11).
21 int *p
= f().a
; // cpp-warning {{temporary whose address is used as value of local variable 'p' will be destroyed at the end of the full-expression}}