[llvm-branch-commits] [cfe-branch] r120667 - in /cfe/branches/Apple/whitney: lib/Sema/SemaExpr.cpp test/SemaCXX/friend.cpp
Daniel Dunbar
daniel at zuster.org
Wed Dec 1 18:52:20 PST 2010
Author: ddunbar
Date: Wed Dec 1 20:52:20 2010
New Revision: 120667
URL: http://llvm.org/viewvc/llvm-project?rev=120667&view=rev
Log:
Merge r120389:
--
Author: Nico Weber <nicolasweber at gmx.de>
Date: Tue Nov 30 04:44:33 2010 +0000
Fix bug in r120299 spotted by dgregor.
Modified:
cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp
cfe/branches/Apple/whitney/test/SemaCXX/friend.cpp
Modified: cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp?rev=120667&r1=120666&r2=120667&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Sema/SemaExpr.cpp Wed Dec 1 20:52:20 2010
@@ -3481,10 +3481,10 @@
ParmVarDecl *Param) {
if (Param->hasUnparsedDefaultArg()) {
Diag(CallLoc,
- diag::err_use_of_default_argument_to_function_declared_later) <<
+ diag::err_use_of_default_argument_to_function_declared_later) <<
FD << cast<CXXRecordDecl>(FD->getDeclContext())->getDeclName();
Diag(UnparsedDefaultArgLocs[Param],
- diag::note_default_argument_declared_here);
+ diag::note_default_argument_declared_here);
return ExprError();
}
@@ -3506,7 +3506,7 @@
// The names in the [default argument] expression are bound, and
// the semantic constraints are checked, at the point where the
// default argument expression appears.
- ContextRAII SavedContext(*this, FD->getDeclContext());
+ ContextRAII SavedContext(*this, FD);
Result = SubstExpr(UninstExpr, ArgList);
}
if (Result.isInvalid())
Modified: cfe/branches/Apple/whitney/test/SemaCXX/friend.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/test/SemaCXX/friend.cpp?rev=120667&r1=120666&r2=120667&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/test/SemaCXX/friend.cpp (original)
+++ cfe/branches/Apple/whitney/test/SemaCXX/friend.cpp Wed Dec 1 20:52:20 2010
@@ -112,3 +112,21 @@
vector<A> v(1);
}
}
+namespace test6_3 {
+ template<class T>
+ class vector {
+ public:
+ vector(int i) {}
+ void f(const T& t = T()) {}
+ };
+ class A {
+ public:
+ private:
+ friend void vector<A>::f(const A&);
+ A() {}
+ };
+ void f() {
+ vector<A> v(1);
+ v.f();
+ }
+}
More information about the llvm-branch-commits
mailing list