summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-01-07 19:42:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-01-07 19:42:26 +0000
commit917316fc5d910f9af26e592eef69f6d79397ba6d (patch)
tree60bfe43a7e8a1fca4cfdad2757325ff1ed835014 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentfe4e7d0c94efef838d26e907411058dee1abc72b (diff)
downloadbcm5719-llvm-917316fc5d910f9af26e592eef69f6d79397ba6d.tar.gz
bcm5719-llvm-917316fc5d910f9af26e592eef69f6d79397ba6d.zip
Consistently use a ConstantEvaluated context for expressions in attributes,
except for those with the "attributes are unevaluated contexts" flag. llvm-svn: 291358
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index f4013b82064..e7679fc11e2 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -173,7 +173,8 @@ static void instantiateDependentEnableIfAttr(
const EnableIfAttr *A, const Decl *Tmpl, Decl *New) {
Expr *Cond = nullptr;
{
- EnterExpressionEvaluationContext Unevaluated(S, Sema::Unevaluated);
+ ContextRAII SwitchContext(*this, cast<FunctionDecl>(New));
+ EnterExpressionEvaluationContext Unevaluated(S, Sema::ConstantEvaluated);
ExprResult Result = S.SubstExpr(A->getCond(), TemplateArgs);
if (Result.isInvalid())
return;
OpenPOWER on IntegriCloud