diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-07-07 02:20:13 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-07-07 02:20:13 +0000 |
commit | e4f22adc862ca3e689c5cefa06dc52c480236805 (patch) | |
tree | feab7daf056e1df550337bf7f197b859813c0a52 /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 82905749d5c8d8b4edec11de754a73349cb96603 (diff) |
In an in-class initialization, defer checks for value-dependent initialization
expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 675cef7986..edafb00c22 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1812,9 +1812,11 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, ExprResult NewInit = SubstExpr(OldInit, TemplateArgs); // If the initialization is no longer dependent, check it now. - if ((OldField->getType()->isDependentType() || OldInit->isTypeDependent()) - && !NewField->getType()->isDependentType() - && !NewInit.get()->isTypeDependent()) { + if ((OldField->getType()->isDependentType() || OldInit->isTypeDependent() || + OldInit->isValueDependent()) && + !NewField->getType()->isDependentType() && + !NewInit.get()->isTypeDependent() && + !NewInit.get()->isValueDependent()) { // FIXME: handle list-initialization SourceLocation EqualLoc = NewField->getLocation(); NewInit = PerformCopyInitialization( |