diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-05 17:52:24 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-06-05 17:52:24 +0000 |
commit | 6af41328be9a8328f993cde20eeea7174e665d2b (patch) | |
tree | 92bea38c9a37729e02a09344f0e3cf7d9bbfe01e /clang/lib/Sema | |
parent | 4d90dba742fd0ec0f67dbd4d53c7e7213ce442ea (diff) | |
download | bcm5719-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')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 1 |
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; } |