]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/SemaCXX/address-of-temporary.cpp
Update clang to r100181.
[FreeBSD/FreeBSD.git] / test / SemaCXX / address-of-temporary.cpp
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
8 void *f0() { return &X(); } // expected-warning{{taking the address of a temporary object}}
9 void *f1() { return &X(1); } // expected-warning{{taking the address of a temporary object}}
10 void *f2() { return &X(1, 2); } // expected-warning{{taking the address of a temporary object}}
11 void *f3() { return &(X)1; } // expected-warning{{taking the address of a temporary object}}
12