[cfe-commits] r144980 - in /cfe/trunk: lib/Parse/ParseCXXInlineMethods.cpp test/Parser/DelayedTemplateParsing.cpp
Francois Pichet
pichet2000 at gmail.com
Fri Nov 18 15:47:17 PST 2011
Author: fpichet
Date: Fri Nov 18 17:47:17 2011
New Revision: 144980
URL: http://llvm.org/viewvc/llvm-project?rev=144980&view=rev
Log:
Enable delayed template parsing for friend functions declared at template class scope.
Modified:
cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
cfe/trunk/test/Parser/DelayedTemplateParsing.cpp
Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=144980&r1=144979&r2=144980&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Fri Nov 18 17:47:17 2011
@@ -110,8 +110,7 @@
if (getLang().DelayedTemplateParsing &&
((Actions.CurContext->isDependentContext() ||
TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) &&
- !Actions.IsInsideALocalClassWithinATemplateFunction()) &&
- !D.getDeclSpec().isFriendSpecified()) {
+ !Actions.IsInsideALocalClassWithinATemplateFunction())) {
if (FnD) {
LateParsedTemplatedFunction *LPT =
Modified: cfe/trunk/test/Parser/DelayedTemplateParsing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/DelayedTemplateParsing.cpp?rev=144980&r1=144979&r2=144980&view=diff
==============================================================================
--- cfe/trunk/test/Parser/DelayedTemplateParsing.cpp (original)
+++ cfe/trunk/test/Parser/DelayedTemplateParsing.cpp Fri Nov 18 17:47:17 2011
@@ -12,6 +12,10 @@
class B {
void foo4() { } // expected-note {{previous definition is here}} expected-note {{previous definition is here}}
void foo4() { } // expected-error {{class member cannot be redeclared}} expected-error {{redefinition of 'foo4'}} expected-note {{previous definition is here}}
+
+ friend void foo3() {
+ undeclared();
+ }
};
More information about the cfe-commits
mailing list