summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/address-of-temporary.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Warn if a local variable's initializer retains a pointer/reference to aRichard Smith2018-07-241-9/+10
| | | | | | non-lifetime-extended temporary object. llvm-svn: 337790
* Correctly classify T{} as an array temporary if T is an array of class type ↵Richard Smith2013-02-021-0/+7
| | | | | | with nontrivial destructor. llvm-svn: 174261
* Add a warning for when an array-to-pointer decay is performed on an arrayRichard Smith2012-06-041-2/+38
| | | | | | | | | | | | | | | temporary or an array subobject of a class temporary, and the resulting value is used to initialize a pointer which outlives the temporary. Such a pointer is always left dangling after the initialization completes and the array's lifetime ends. In order to detect this situation, this change also adds an LValueClassification of LV_ArrayTemporary for temporaries of array type which aren't subobjects of class temporaries. These occur in C++11 T{...} and GNU C++ (T){...} expressions, when T is an array type. Previously we treated the former as a generic prvalue and the latter as a class temporary. llvm-svn: 157955
* Follow through references to catch returned stack addresses, local blocks, ↵Argyrios Kyrtzidis2010-11-301-4/+4
| | | | | | | | | | | | label addresses or references to temporaries, e.g: const int& g2() { int s1; int &s2 = s1; // expected-note {{binding reference variable 's2' here}} return s2; // expected-warning {{reference to stack memory associated with local variable 's1' returned}} } llvm-svn: 120483
* Introduce a new kind of failed result for isLvalue/isModifiableLvalueDouglas Gregor2010-02-161-0/+12
which describes temporary objects of class type in C++. Use this to provide a more-specific, remappable diagnostic when takin the address of such a temporary. llvm-svn: 96396
OpenPOWER on IntegriCloud