summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-07-17 00:11:41 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-07-17 00:11:41 +0000
commit0a9969b36b16307e6cf60004b108be972c93d336 (patch)
treeb9e216b9ac175f3a86b748a5effc1190bb161793 /clang/lib/Sema/SemaExprCXX.cpp
parent1c1de452570b525f1a7ed9f7da919e0af16c23bd (diff)
downloadbcm5719-llvm-0a9969b36b16307e6cf60004b108be972c93d336.tar.gz
bcm5719-llvm-0a9969b36b16307e6cf60004b108be972c93d336.zip
Restructure checking for, and warning on, lifetime extension.
This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. llvm-svn: 337226
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index fbf572e3987..a7ad8e322d8 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -1864,13 +1864,6 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
if (CheckAllocatedType(AllocType, TypeRange.getBegin(), TypeRange))
return ExprError();
- if (initStyle == CXXNewExpr::ListInit &&
- isStdInitializerList(AllocType, nullptr)) {
- Diag(AllocTypeInfo->getTypeLoc().getBeginLoc(),
- diag::warn_dangling_std_initializer_list)
- << /*at end of FE*/0 << Inits[0]->getSourceRange();
- }
-
// In ARC, infer 'retaining' for the allocated
if (getLangOpts().ObjCAutoRefCount &&
AllocType.getObjCLifetime() == Qualifiers::OCL_None &&
OpenPOWER on IntegriCloud