diff options
author | John McCall <rjmccall@apple.com> | 2010-08-27 09:08:28 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-27 09:08:28 +0000 |
commit | 8d08b9b408ca26c1a865f2d4c61ba4426b95062a (patch) | |
tree | 0032e04ba8db553e0df2738467e9f20cff18951f /clang/lib/AST/ExprClassification.cpp | |
parent | 788a6079e100b8247e609aec5e58edb6c837bd43 (diff) | |
download | bcm5719-llvm-8d08b9b408ca26c1a865f2d4c61ba4426b95062a.tar.gz bcm5719-llvm-8d08b9b408ca26c1a865f2d4c61ba4426b95062a.zip |
Propagate whether an id-expression is the immediate argument of
an '&' expression from the second caller of ActOnIdExpression.
Teach template argument deduction that an overloaded id-expression
doesn't give a valid type for deduction purposes to a non-static
member function unless the expression has the correct syntactic
form.
Teach ActOnIdExpression that it shouldn't try to create implicit
member expressions for '&function', because this isn't a
permitted form of use for member functions.
Teach CheckAddressOfOperand to diagnose these more carefully.
Some of these cases aren't reachable right now because earlier
diagnostics interrupt them.
llvm-svn: 112258
Diffstat (limited to 'clang/lib/AST/ExprClassification.cpp')
-rw-r--r-- | clang/lib/AST/ExprClassification.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index c54dcb60b9d..d7e38ebbf5c 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -229,6 +229,10 @@ static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) { // In addition, NonTypeTemplateParmDecl derives from VarDecl but isn't an // lvalue unless it's a reference type (C++ [temp.param]p6), so we need to // special-case this. + + if (isa<CXXMethodDecl>(D) && cast<CXXMethodDecl>(D)->isInstance()) + return Cl::CL_MemberFunction; + bool islvalue; if (const NonTypeTemplateParmDecl *NTTParm = dyn_cast<NonTypeTemplateParmDecl>(D)) |