Home | History | Annotate | Download | only in SemaCXX

Lines Matching full:temporary

1 // RUN: %clang_cc1 -fsyntax-only -Wno-error=address-of-temporary -verify -std=gnu++11 %s
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}}
29 void g0() { int *p = Y().a; } // expected-warning{{pointer is initialized by a temporary array}}
30 void g1() { int *p = Y{}.a; } // expected-warning{{pointer is initialized by a temporary array}}
31 void g2() { int *p = A{}; } // expected-warning{{pointer is initialized by a temporary array}}
32 void g3() { int *p = (A){}; } // expected-warning{{pointer is initialized by a temporary array}}
33 void g4() { Z *p = AZ{}; } // expected-warning{{pointer is initialized by a temporary array}}
41 void i0() { S s = { Y().a }; } // expected-warning{{pointer is initialized by a temporary array}}
42 void i1() { S s = { Y{}.a }; } // expected-warning{{pointer is initialized by a temporary array}}
43 void i2() { S s = { A{} }; } // expected-warning{{pointer is initialized by a temporary array}}
44 void i3() { S s = { (A){} }; } // expected-warning{{pointer is initialized by a temporary array}}