Fix for PR 16367, display the name of a function in a diagnostic instead of

showing "(null)".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Richard Trieu 2013-06-19 22:25:01 +00:00
parent d4fbdc7100
commit 6e91f4bd9a
2 changed files with 9 additions and 1 deletions

View File

@ -1272,7 +1272,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
Range.setBegin(SS.getBeginLoc());
Diag(TemplateId->LAngleLoc, diag::err_template_spec_syntax_non_template)
<< Name << static_cast<int>(TemplateId->Kind) << Range;
<< TemplateId->Name << static_cast<int>(TemplateId->Kind) << Range;
DS.SetTypeSpecError();
SkipUntil(tok::semi, false, true);

View File

@ -0,0 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
struct A {
template<typename T>
void f();
};
class A::f<int>;
// expected-error@-1 {{identifier followed by '<' indicates a class template specialization but 'f' refers to a function template}}