diff options
author | Alex Lorenz <arphaman@gmail.com> | 2017-10-27 18:13:31 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2017-10-27 18:13:31 +0000 |
commit | 1c09b76713c0a3521937e035b3ab4edef687e7ee (patch) | |
tree | 72dc065615701109fbb95696b41b5c82bfb8cb74 /lib/Sema/SemaDecl.cpp | |
parent | d64b9c663c0575c69a772118b184928319e4689c (diff) |
[Sema] Fix an assert-on-invalid by avoiding function template specialisation
deduction for invalid functions
The fabricated template parameters cause an assertion because their depth
is invalid.
rdar://34109988
Differential Revision: https://reviews.llvm.org/D37341
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316778 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 573c1af8d2..d68b430bae 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8962,10 +8962,10 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, diag::ext_function_specialization_in_class : diag::err_function_specialization_in_class) << NewFD->getDeclName(); - } else if (CheckFunctionTemplateSpecialization(NewFD, - (HasExplicitTemplateArgs ? &TemplateArgs - : nullptr), - Previous)) + } else if (!NewFD->isInvalidDecl() && + CheckFunctionTemplateSpecialization( + NewFD, (HasExplicitTemplateArgs ? &TemplateArgs : nullptr), + Previous)) NewFD->setInvalidDecl(); // C++ [dcl.stc]p1: |