When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 22bdc79..4149fa4 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2581,7 +2581,7 @@
// };
// Attach the initializer
- VDecl->setInit(Init);
+ VDecl->setInit(Context, Init);
// C++ [class.mem]p4:
// A member-declarator can contain a constant-initializer only
@@ -2644,7 +2644,7 @@
}
// Attach the initializer to the decl.
- VDecl->setInit(Init);
+ VDecl->setInit(Context, Init);
// If the previous declaration of VDecl was a tentative definition,
// remove it from the set of tentative definitions.