aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprMember.cpp
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-02-25 00:11:55 +0000
committerDeLesley Hutchins <delesley@google.com>2012-02-25 00:11:55 +0000
commitd08d599da101f3fe3fd79e853f1dcea6be89d7c2 (patch)
treecc8d697829e76273c8be625e49efceb438d2cf24 /lib/Sema/SemaExprMember.cpp
parent4a59bc26b3f2d00055e24332c3164c894fafac27 (diff)
Bugfix: bogus warning -- "invalid use of non-static data member",
when a class is forward declared, and the reference to the data member in question does not occur within a method body. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprMember.cpp')
-rw-r--r--lib/Sema/SemaExprMember.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprMember.cpp b/lib/Sema/SemaExprMember.cpp
index 92cf619d92..54296942d0 100644
--- a/lib/Sema/SemaExprMember.cpp
+++ b/lib/Sema/SemaExprMember.cpp
@@ -173,7 +173,8 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef,
// ...if C is not X or a base class of X, the class member access expression
// is ill-formed.
if (R.getNamingClass() &&
- contextClass != R.getNamingClass()->getCanonicalDecl() &&
+ contextClass->getCanonicalDecl() !=
+ R.getNamingClass()->getCanonicalDecl() &&
contextClass->isProvablyNotDerivedFrom(R.getNamingClass()))
return (hasNonInstance ? IMA_Mixed_Unrelated : IMA_Error_Unrelated);