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 | |
Argyrios Kyrtzidis | 26e10be | 2010-11-30 22:57:32 +0000 | [diff] [blame] | 8 | void f0() { (void)&X(); } // expected-warning{{taking the address of a temporary object}} |
| 9 | void f1() { (void)&X(1); } // expected-warning{{taking the address of a temporary object}} |
| 10 | void f2() { (void)&X(1, 2); } // expected-warning{{taking the address of a temporary object}} |
| 11 | void f3() { (void)&(X)1; } // expected-warning{{taking the address of a temporary object}} |
Douglas Gregor | e873fb7 | 2010-02-16 21:39:57 +0000 | [diff] [blame] | 12 | |