aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-12 17:27:19 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-12 17:27:19 +0000
commit9679cafc6368cceed1a5e69d3038d0316401b352 (patch)
tree085baf14d9e13011b61e720707bac092d11a76dd /lib/Sema/SemaTemplateInstantiateDecl.cpp
parentc63d2c8469d6b96712b324f76b4af07e1852313f (diff)
Whenever we instantiate a function definition or class, enter a new
potentially-evaluated expression context, to ensure that used declarations get properly marked. Fixes PR7123. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index d3d6c2209f..adba32ecec 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2011,6 +2011,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation,
if (Recursive)
PendingImplicitInstantiations.swap(SavedPendingImplicitInstantiations);
+ EnterExpressionEvaluationContext EvalContext(*this,
+ Action::PotentiallyEvaluated);
ActOnStartOfFunctionDef(0, DeclPtrTy::make(Function));
// Introduce a new scope where local variable instantiations will be