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