]> granicus.if.org Git - clang/commit
Restructure checking for, and warning on, lifetime extension.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Jul 2018 22:24:09 +0000 (22:24 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 17 Jul 2018 22:24:09 +0000 (22:24 +0000)
commit43554aef455595d09c8da17584ceeb7a65c4fc2a
tree2fb8c25870c839a8692ebc95eaee8e9ba410acf6
parent4fbd5c5474db41197df34d8e9eaae28967a30aa4
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.

This reinstates r337226, reverted in r337255, with a fix for the
InitializedEntity alignment problem that was breaking ARM buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337329 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Initialization.h
include/clang/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaInit.cpp
test/Analysis/initializer.cpp
test/CXX/drs/dr16xx.cpp
test/CXX/drs/dr18xx.cpp
test/CXX/special/class.copy/p11.0x.copy.cpp
test/CXX/special/class.copy/p11.0x.move.cpp
test/CXX/special/class.ctor/p5-0x.cpp
test/CXX/temp/temp.param/p5.cpp
test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp
test/CodeGenCXX/temporaries.cpp
test/SemaCXX/constant-expression-cxx11.cpp
test/SemaCXX/constexpr-default-arg.cpp
test/SemaCXX/cxx0x-initializer-stdinitializerlist.cpp
test/SemaCXX/eval-crashes.cpp
test/SemaCXX/member-init.cpp
test/SemaCXX/warn-dangling-field.cpp
www/cxx_dr_status.html