YouCompleteMe/cpp/llvm/tools/clang/test/SemaCXX/address-of-temporary.cpp
Strahinja Val Markovic 1f51a89d39 Adding more llvm/clang files
These were ignored by git accidentally. We want ALL OF THEM since they all came
in the llvm/clang source distribution.
2012-07-05 17:55:45 -07:00

13 lines
491 B
C++

// RUN: %clang_cc1 -fsyntax-only -Wno-error=address-of-temporary -verify %s
struct X {
X();
X(int);
X(int, int);
};
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}}