aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-11-09 03:59:26 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-11-09 03:59:26 +0000
commitbb4a33cdf6342110811ae16f7ca6accababf432f (patch)
treed8db2ec7ec2315d45ae36b6dc9615cc7957058d3 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent63d423dab6b5fcc107286f8d38f0e64c220da3a6 (diff)
Add hack to make the given testcase work. As far as I can tell, this change is
reasonably safe, but it doesn't seem like the right solution. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 641ea24427..33d262311c 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -188,11 +188,13 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
Var->setInvalidDecl();
else if (!D->getType()->isDependentType() &&
!D->getInit()->isTypeDependent() &&
- !D->getInit()->isValueDependent()) {
+ !D->getInit()->isValueDependent() &&
+ !isa<InitListExpr>(D->getInit())) {
// If neither the declaration's type nor its initializer are dependent,
// we don't want to redo all the checking, especially since the
// initializer might have been wrapped by a CXXConstructExpr since we did
// it the first time.
+ // FIXME: The InitListExpr handling here is a hack!
Var->setInit(SemaRef.Context, Init.takeAs<Expr>());
}
else if (ParenListExpr *PLE = dyn_cast<ParenListExpr>((Expr *)Init.get())) {