aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2012-09-25 07:32:39 +0000
committerJohn McCall <rjmccall@apple.com>2012-09-25 07:32:39 +0000
commite402e72273cde2a64fa6097c1fe93f500038675d (patch)
tree06462d2691ea6e840a20fb9209ee1711b723a529 /lib/Sema/SemaDecl.cpp
parent9f357de8d5823f9b13cf33ad1f6af1dd69b7669f (diff)
Fix for r163013 regression and further __interface enhancement.
Patch by Andy Gibbs! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index fc2d1d6ae6..01aaf8be32 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -5210,11 +5210,12 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
NewFD->setImplicitlyInline();
}
- // if this is a method defined in an __interface, set pure
- // (isVirtual will already return true)
- if (CXXRecordDecl *Parent = dyn_cast<CXXRecordDecl>(
- NewFD->getDeclContext())) {
- if (Parent->getTagKind() == TTK_Interface)
+ // If this is a method defined in an __interface, and is not a constructor
+ // or an overloaded operator, then set the pure flag (isVirtual will already
+ // return true).
+ if (const CXXRecordDecl *Parent =
+ dyn_cast<CXXRecordDecl>(NewFD->getDeclContext())) {
+ if (Parent->isInterface() && cast<CXXMethodDecl>(NewFD)->isUserProvided())
NewFD->setPure(true);
}