summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorTaiju Tsuiki <tzik@google.com>2018-06-19 05:35:30 +0000
committerTaiju Tsuiki <tzik@google.com>2018-06-19 05:35:30 +0000
commit3be68e162ffbf992c2efbc70983d27c05739a8b0 (patch)
treece47a7000d746109fb539ef4741b57eea3295118 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parentea798aa7f596060d4be4e3c6bcadcda77a63829e (diff)
downloadbcm5719-llvm-3be68e162ffbf992c2efbc70983d27c05739a8b0.tar.gz
bcm5719-llvm-3be68e162ffbf992c2efbc70983d27c05739a8b0.zip
Revert r335019 "Update NRVO logic to support early return (Attempt 2)"
llvm-svn: 335022
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 7e38dcc7959..68857d972b5 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -740,13 +740,12 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D,
SemaRef.BuildVariableInstantiation(Var, D, TemplateArgs, LateAttrs, Owner,
StartingScope, InstantiatingVarTemplate);
- bool NRVO = false;
if (D->isNRVOVariable()) {
QualType ReturnType = cast<FunctionDecl>(DC)->getReturnType();
if (SemaRef.isCopyElisionCandidate(ReturnType, Var, Sema::CES_Strict))
- NRVO = true;
+ Var->setNRVOVariable(true);
}
- Var->setNRVOVariable(NRVO);
+
Var->setImplicit(D->isImplicit());
return Var;
OpenPOWER on IntegriCloud