r184377 - Fix for PR 16367, display the name of a function in a diagnostic instead of
Richard Trieu
rtrieu at google.com
Wed Jun 19 15:25:01 PDT 2013
Author: rtrieu
Date: Wed Jun 19 17:25:01 2013
New Revision: 184377
URL: http://llvm.org/viewvc/llvm-project?rev=184377&view=rev
Log:
Fix for PR 16367, display the name of a function in a diagnostic instead of
showing "(null)".
Added:
cfe/trunk/test/Parser/cxx-class-template-specialization.cpp
Modified:
cfe/trunk/lib/Parse/ParseDeclCXX.cpp
Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=184377&r1=184376&r2=184377&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Wed Jun 19 17:25:01 2013
@@ -1272,7 +1272,7 @@ void Parser::ParseClassSpecifier(tok::To
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);
Added: cfe/trunk/test/Parser/cxx-class-template-specialization.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-class-template-specialization.cpp?rev=184377&view=auto
==============================================================================
--- cfe/trunk/test/Parser/cxx-class-template-specialization.cpp (added)
+++ cfe/trunk/test/Parser/cxx-class-template-specialization.cpp Wed Jun 19 17:25:01 2013
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A {
+ template<typename T>
+ void f();
+};
+class A::f<int>;
+// expected-error at -1 {{identifier followed by '<' indicates a class template specialization but 'f' refers to a function template}}
More information about the cfe-commits
mailing list