aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-15 07:58:29 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-15 07:58:29 +0000
commit02d65ee373feb1cb029185aa0de04d0c214eda3d (patch)
tree7ecde5f19cecc5e4e2c8748bb54ba4cbc0a5af5a /lib
parenta121eb3af061a9402aa88630a0eb535d92962e2c (diff)
Don't crash when binding a reference to a temporary pointer created from
resolving an overloaded function reference within an initializer list. Previously we would try to resolve the overloaded function reference without first stripping off the InitListExpr wrapper. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaInit.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 94dd2aa45c..26bb6efb8e 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -3024,6 +3024,10 @@ static void TryReferenceListInitialization(Sema &S,
Sequence.RewrapReferenceInitList(cv1T1, InitList);
return;
}
+
+ // Update the initializer if we've resolved an overloaded function.
+ if (Sequence.step_begin() != Sequence.step_end())
+ Sequence.RewrapReferenceInitList(cv1T1, InitList);
}
// Not reference-related. Create a temporary and bind to that.