blob: eb5dee50598e24808545c95bf2eda98ba78b5454 [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
Argyrios Kyrtzidis26e10be2010-11-30 22:57:32 +00008void f0() { (void)&X(); } // expected-warning{{taking the address of a temporary object}}
9void f1() { (void)&X(1); } // expected-warning{{taking the address of a temporary object}}
10void f2() { (void)&X(1, 2); } // expected-warning{{taking the address of a temporary object}}
11void f3() { (void)&(X)1; } // expected-warning{{taking the address of a temporary object}}
Douglas Gregore873fb72010-02-16 21:39:57 +000012