[cfe-commits] r116144 - in /cfe/trunk: lib/Sema/SemaDecl.cpp test/SemaCXX/friend.cpp
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Oct 8 21:39:54 PDT 2010
Author: akirtzidis
Date: Fri Oct 8 23:39:54 2010
New Revision: 116144
URL: http://llvm.org/viewvc/llvm-project?rev=116144&view=rev
Log:
Fix g++.dg regressions introduced at r115347 (rdar://8529993)
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/test/SemaCXX/friend.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=116144&r1=116143&r2=116144&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Oct 8 23:39:54 2010
@@ -3675,7 +3675,7 @@
}
if (D.getCXXScopeSpec().isSet() && !NewFD->isInvalidDecl()) {
- if (!CurContext->isRecord()) {
+ if (isFriend || !CurContext->isRecord()) {
// Fake up an access specifier if it's supposed to be a class member.
if (!Redeclaration && isa<CXXRecordDecl>(NewFD->getDeclContext()))
NewFD->setAccess(AS_public);
@@ -3722,7 +3722,7 @@
Diag((*Func)->getLocation(), diag::note_member_def_close_match);
}
}
- } else if (!isFriend) {
+ } else {
// The user provided a superfluous scope specifier inside a class definition:
//
// class X {
Modified: cfe/trunk/test/SemaCXX/friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/friend.cpp?rev=116144&r1=116143&r2=116144&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/friend.cpp (original)
+++ cfe/trunk/test/SemaCXX/friend.cpp Fri Oct 8 23:39:54 2010
@@ -62,3 +62,12 @@
class T4B {};
}
+
+namespace rdar8529993 {
+struct A { ~A(); }; // expected-note {{nearly matches}}
+
+struct B : A
+{
+ template<int> friend A::~A(); // expected-error {{does not match}}
+};
+}
More information about the cfe-commits
mailing list