Douglas Gregor | e873fb7 | 2010-02-16 21:39:57 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -Wno-error=address-of-temporary -verify %s |
| 2 | struct X { |
| 3 | X(); |
| 4 | X(int); |
| 5 | X(int, int); |
| 6 | }; |
| 7 | |
| 8 | void *f0() { return &X(); } // expected-warning{{taking the address of a temporary object}} |
| 9 | void *f1() { return &X(1); } // expected-warning{{taking the address of a temporary object}} |
| 10 | void *f2() { return &X(1, 2); } // expected-warning{{taking the address of a temporary object}} |
| 11 | void *f3() { return &(X)1; } // expected-warning{{taking the address of a temporary object}} |
| 12 | |