diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 06:10:21 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-01-09 06:10:21 +0000 |
commit | ea6cc726d11365a23ac85d1c3d5884809895843e (patch) | |
tree | 10188de56a30e11022437b8d185df9e23e041923 /lib/Sema | |
parent | d3711a0f2df82a2b5a325e49c04ff527a1a5d07e (diff) |
Sema: Don't crash when specializing a global scope function in a class
We assumed that class-scope specializations would result in a
CXXMethodDecl for that class. However, globally qualified functions
will result in normal FunctionDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@225508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 8a5047592a..1e20121b37 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -7482,7 +7482,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, } else if (isFunctionTemplateSpecialization) { if (CurContext->isDependentContext() && CurContext->isRecord() && !isFriend) { - isDependentClassScopeExplicitSpecialization = true; + isDependentClassScopeExplicitSpecialization = isa<CXXMethodDecl>(NewFD); Diag(NewFD->getLocation(), getLangOpts().MicrosoftExt ? diag::ext_function_specialization_in_class : diag::err_function_specialization_in_class) |