diff options
author | Saar Raz <saar@raz.email> | 2020-01-27 00:57:31 +0200 |
---|---|---|
committer | Saar Raz <saar@raz.email> | 2020-01-27 01:00:12 +0200 |
commit | b39efdbcfcb7c7a5e867a99c2d3e756c538fbb9f (patch) | |
tree | 0ac8ee67b7cc32ccd770e756e3754337f3e29ac7 /clang/lib/Sema | |
parent | b07b82777b9ad19c44c6eb347507f1fdda3ddf34 (diff) | |
download | bcm5719-llvm-b39efdbcfcb7c7a5e867a99c2d3e756c538fbb9f.tar.gz bcm5719-llvm-b39efdbcfcb7c7a5e867a99c2d3e756c538fbb9f.zip |
[Concepts] Fix incorrect TemplateArgs for introduction of local parameters
The wrong set of TemplateArgs was being provided to addInstantiatedParametersToScope.
Caused bug #44658.
(cherry picked from commit 9c24fca2a33fc0fd059e278bb95c84803dfff9ae)
Diffstat (limited to 'clang/lib/Sema')
-rwxr-xr-x | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index fbbab8f0070..2e437cbe44d 100755 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -4246,18 +4246,17 @@ bool Sema::CheckInstantiatedFunctionTemplateConstraints( Sema::ContextRAII savedContext(*this, Decl); LocalInstantiationScope Scope(*this); - MultiLevelTemplateArgumentList MLTAL = - getTemplateInstantiationArgs(Decl, nullptr, /*RelativeToPrimary*/true); - // If this is not an explicit specialization - we need to get the instantiated // version of the template arguments and add them to scope for the // substitution. if (Decl->isTemplateInstantiation()) { InstantiatingTemplate Inst(*this, Decl->getPointOfInstantiation(), InstantiatingTemplate::ConstraintsCheck{}, Decl->getPrimaryTemplate(), - MLTAL.getInnermost(), SourceRange()); + TemplateArgs, SourceRange()); if (Inst.isInvalid()) return true; + MultiLevelTemplateArgumentList MLTAL( + *Decl->getTemplateSpecializationArgs()); if (addInstantiatedParametersToScope( *this, Decl, Decl->getPrimaryTemplate()->getTemplatedDecl(), Scope, MLTAL)) |