aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2012-03-08 01:15:31 +0000
committerRichard Trieu <rtrieu@google.com>2012-03-08 01:15:31 +0000
commitffea6b4560cee39bd2a26f478e57da19fc3b47b2 (patch)
tree4d2c53022abb4edd58f76933dbd6f4f2dfed1ca7 /lib/Sema/SemaDecl.cpp
parent29f98b40caabca1ec820d546c5c08206a1d4f520 (diff)
Fix -Wuninitialized to catch the case of a class being initialized with a call
to its own member function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 7a0ae94739..33656c9d52 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5993,7 +5993,8 @@ namespace {
void VisitMemberExpr(MemberExpr *E) {
if (E->getType()->canDecayToPointerType()) return;
- if (isa<FieldDecl>(E->getMemberDecl()))
+ ValueDecl *VD = E->getMemberDecl();
+ if (isa<FieldDecl>(VD) || isa<CXXMethodDecl>(VD))
if (DeclRefExpr *DRE
= dyn_cast<DeclRefExpr>(E->getBase()->IgnoreParenImpCasts())) {
HandleDeclRefExpr(DRE);