diff options
author | Richard Trieu <rtrieu@google.com> | 2013-06-19 22:25:01 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2013-06-19 22:25:01 +0000 |
commit | 30f93859a9ebf4b46c789a1bd2b600710b9b4fb9 (patch) | |
tree | abd3f194c82e4832d1ef2ee504c77a9f00c1c5cc | |
parent | 7ed411062b69dc705a32f356a31ba6ed777631e1 (diff) | |
download | bcm5719-llvm-30f93859a9ebf4b46c789a1bd2b600710b9b4fb9.tar.gz bcm5719-llvm-30f93859a9ebf4b46c789a1bd2b600710b9b4fb9.zip |
Fix for PR 16367, display the name of a function in a diagnostic instead of
showing "(null)".
llvm-svn: 184377
-rw-r--r-- | clang/lib/Parse/ParseDeclCXX.cpp | 2 | ||||
-rw-r--r-- | clang/test/Parser/cxx-class-template-specialization.cpp | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp index 71ee3118c9a..f09aaf5c0bb 100644 --- a/clang/lib/Parse/ParseDeclCXX.cpp +++ b/clang/lib/Parse/ParseDeclCXX.cpp @@ -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); diff --git a/clang/test/Parser/cxx-class-template-specialization.cpp b/clang/test/Parser/cxx-class-template-specialization.cpp new file mode 100644 index 00000000000..f94a85964a7 --- /dev/null +++ b/clang/test/Parser/cxx-class-template-specialization.cpp @@ -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}} |