2010-02-17 05:39:57 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -Wno-error=address-of-temporary -verify %s
|
|
|
|
struct X {
|
|
|
|
X();
|
|
|
|
X(int);
|
|
|
|
X(int, int);
|
|
|
|
};
|
|
|
|
|
2010-12-01 06:57:32 +08:00
|
|
|
void f0() { (void)&X(); } // expected-warning{{taking the address of a temporary object}}
|
|
|
|
void f1() { (void)&X(1); } // expected-warning{{taking the address of a temporary object}}
|
|
|
|
void f2() { (void)&X(1, 2); } // expected-warning{{taking the address of a temporary object}}
|
|
|
|
void f3() { (void)&(X)1; } // expected-warning{{taking the address of a temporary object}}
|
2010-02-17 05:39:57 +08:00
|
|
|
|