summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-08 00:08:23 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-08 00:08:23 +0000
commit27874d603b805b589344359ced4f6620e784c6c2 (patch)
tree45f15142e055645935e0b343f469981dc78e8067 /clang/lib/Sema/SemaInit.cpp
parent21444b96c84f91afc8a4c1b50b5f0c43002ab3dc (diff)
downloadbcm5719-llvm-27874d603b805b589344359ced4f6620e784c6c2.tar.gz
bcm5719-llvm-27874d603b805b589344359ced4f6620e784c6c2.zip
PR14838: When a member reference is bound to a temporary, don't forget to
perform the semantic checks associated with the destruction of that temporary. It'll be destroyed at the end of the constructor. llvm-svn: 171818
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 6796f9a5500..111f81e4499 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -4290,7 +4290,7 @@ getAssignmentAction(const InitializedEntity &Entity) {
llvm_unreachable("Invalid EntityKind!");
}
-/// \brief Whether we should binding a created object as a temporary when
+/// \brief Whether we should bind a created object as a temporary when
/// initializing the given entity.
static bool shouldBindAsTemporary(const InitializedEntity &Entity) {
switch (Entity.getKind()) {
@@ -4320,7 +4320,6 @@ static bool shouldBindAsTemporary(const InitializedEntity &Entity) {
/// created for that initialization, requires destruction.
static bool shouldDestroyTemporary(const InitializedEntity &Entity) {
switch (Entity.getKind()) {
- case InitializedEntity::EK_Member:
case InitializedEntity::EK_Result:
case InitializedEntity::EK_New:
case InitializedEntity::EK_Base:
@@ -4331,6 +4330,7 @@ static bool shouldDestroyTemporary(const InitializedEntity &Entity) {
case InitializedEntity::EK_LambdaCapture:
return false;
+ case InitializedEntity::EK_Member:
case InitializedEntity::EK_Variable:
case InitializedEntity::EK_Parameter:
case InitializedEntity::EK_Temporary:
OpenPOWER on IntegriCloud