summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-05 17:52:24 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-06-05 17:52:24 +0000
commit6af41328be9a8328f993cde20eeea7174e665d2b (patch)
tree92bea38c9a37729e02a09344f0e3cf7d9bbfe01e /clang/lib/Sema/SemaTemplate.cpp
parent4d90dba742fd0ec0f67dbd4d53c7e7213ce442ea (diff)
downloadbcm5719-llvm-6af41328be9a8328f993cde20eeea7174e665d2b.tar.gz
bcm5719-llvm-6af41328be9a8328f993cde20eeea7174e665d2b.zip
When the template specialization header is missing, set a valid source location for the template keyword when recovering.
Otherwise ClassTemplateSpecializationDecl::getSourceRange() will mistakenly consider itself as an implicit partial specialization and lead to a crash. Fixes rdar://14063074 llvm-svn: 183325
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index ad866a347e5..8621a2d42dc 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -5300,6 +5300,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
} else if (TUK != TUK_Friend) {
Diag(KWLoc, diag::err_template_spec_needs_header)
<< FixItHint::CreateInsertion(KWLoc, "template<> ");
+ TemplateKWLoc = KWLoc;
isExplicitSpecialization = true;
}
OpenPOWER on IntegriCloud