summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-05-19 23:35:23 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-05-19 23:35:23 +0000
commita9e9ebcfb5268f2ebab8c46ea9e025e1c0caeddc (patch)
tree8d2edce2d93824f18acc45c6543bef075bee98c9 /clang/lib
parenta34a69ce0cbb02a9e8306de261ef6dad2363cf29 (diff)
downloadbcm5719-llvm-a9e9ebcfb5268f2ebab8c46ea9e025e1c0caeddc.tar.gz
bcm5719-llvm-a9e9ebcfb5268f2ebab8c46ea9e025e1c0caeddc.zip
Make delegating initializers use a similar codepath to base initializers in dependent contexts. PR12890.
llvm-svn: 157136
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 9571a268459..676063ac084 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -2234,6 +2234,16 @@ Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo, Expr *Init,
if (DelegationInit.isInvalid())
return true;
+ // If we are in a dependent context, template instantiation will
+ // perform this type-checking again. Just save the arguments that we
+ // received in a ParenListExpr.
+ // FIXME: This isn't quite ideal, since our ASTs don't capture all
+ // of the information that we have about the base
+ // initializer. However, deconstructing the ASTs is a dicey process,
+ // and this approach is far more likely to get the corner cases right.
+ if (CurContext->isDependentContext())
+ DelegationInit = Owned(Init);
+
return new (Context) CXXCtorInitializer(Context, TInfo, InitRange.getBegin(),
DelegationInit.takeAs<Expr>(),
InitRange.getEnd());
OpenPOWER on IntegriCloud