diff options
author | Nico Weber <nicolasweber@gmx.de> | 2010-11-28 22:58:38 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2010-11-28 22:58:38 +0000 |
commit | 7ff776eb7d874913588f55df4e6b459d15e20175 (patch) | |
tree | 78ba6cfc289f307b30424dbc8c06319c387185b8 | |
parent | 6bb4dcb412d53d05a80017df81d41e447e2aa3ea (diff) |
Revert parts of r120266 that I did not mean to commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120267 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 16 | ||||
-rw-r--r-- | test/SemaCXX/friend.cpp | 33 |
2 files changed, 4 insertions, 45 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index e8025409bd..087314fbcb 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3839,8 +3839,8 @@ ExprResult Sema::ActOnMemberAccessExpr(Scope *S, Expr *Base, } ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, - FunctionDecl *FD, - ParmVarDecl *Param) { + FunctionDecl *FD, + ParmVarDecl *Param) { if (Param->hasUnparsedDefaultArg()) { Diag(CallLoc, diag::err_use_of_default_argument_to_function_declared_later) << @@ -3857,20 +3857,12 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, MultiLevelTemplateArgumentList ArgList = getTemplateInstantiationArgs(FD, 0, /*RelativeToPrimary=*/true); - std::pair<const TemplateArgument *, unsigned> Innermost + std::pair<const TemplateArgument *, unsigned> Innermost = ArgList.getInnermost(); InstantiatingTemplate Inst(*this, CallLoc, Param, Innermost.first, Innermost.second); - ExprResult Result; - { - // C++ [dcl.fct.default]p5: - // 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()); - Result = SubstExpr(UninstExpr, ArgList); - } + ExprResult Result = SubstExpr(UninstExpr, ArgList); if (Result.isInvalid()) return ExprError(); diff --git a/test/SemaCXX/friend.cpp b/test/SemaCXX/friend.cpp index 515edfd949..939d3ae456 100644 --- a/test/SemaCXX/friend.cpp +++ b/test/SemaCXX/friend.cpp @@ -79,36 +79,3 @@ namespace test5 { struct B { friend void B(); }; } - -// PR8479 -namespace test6_1 { - class A { - public: - private: - friend class vectorA; - A() {} - }; - class vectorA { - public: - vectorA(int i, const A& t = A()) {} - }; - void f() { - vectorA v(1); - } -} -namespace test6_2 { - template<class T> - class vector { - public: - vector(int i, const T& t = T()) {} - }; - class A { - public: - private: - friend class vector<A>; - A() {} - }; - void f() { - vector<A> v(1); - } -} |