diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-03-08 02:08:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-03-08 02:08:05 +0000 |
commit | 5bc37f6e0c932e7a8e0af92b6266372dc7b94cd9 (patch) | |
tree | c27ebb32443a6cd1160e019e43a4b06c3ab8851f /lib/AST/Decl.cpp | |
parent | 9df08bb7661779a1703d29681833b79e62336c22 (diff) |
Loosen the precondition of isCXXInstanceMember() to simply return
"false" for declarations that aren't members of classes. Fixes PR12106.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152284 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index d5e048a7c4..63f1f16ea6 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -997,9 +997,9 @@ NamedDecl *NamedDecl::getUnderlyingDecl() { } bool NamedDecl::isCXXInstanceMember() const { - assert(isCXXClassMember() && - "checking whether non-member is instance member"); - + if (!isCXXClassMember()) + return false; + const NamedDecl *D = this; if (isa<UsingShadowDecl>(D)) D = cast<UsingShadowDecl>(D)->getTargetDecl(); |