aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2016-10-10 20:57:33 +0000
committerJordan Rose <jordan_rose@apple.com>2016-10-10 20:57:33 +0000
commitd77cee3f54bee1d32bd269827b27d889c8962db1 (patch)
tree686aa21d241da1fb1f913e23679578856e4e7d2b /clang/lib/Frontend/CompilerInvocation.cpp
parentfcd2421667582cdceff8bf30d65b262998d3cd59 (diff)
downloadllvm-d77cee3f54bee1d32bd269827b27d889c8962db1.zip
llvm-d77cee3f54bee1d32bd269827b27d889c8962db1.tar.gz
llvm-d77cee3f54bee1d32bd269827b27d889c8962db1.tar.bz2
Disallow ArrayRef assignment from temporaries.
Without this, the following statements will create ArrayRefs that refer to temporary storage that goes out of scope by the end of the line: someArrayRef = getSingleElement(); someArrayRef = {elem1, elem2}; Note that the constructor still has this problem: ArrayRef<Element> someArrayRef = getSingleElement(); ArrayRef<Element> someArrayRef = {elem1, elem2}; but that's a little harder to get rid of because we want to be able to use this in calls: takesArrayRef(getSingleElement()); takesArrayRef({elem1, elem2}); Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith. llvm-svn: 283798
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions