diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-15 17:15:07 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-15 17:15:07 +0000 |
commit | 2039ca061f07fc5fae7ced01ae7d428c3203db7b (patch) | |
tree | c9cae431de102c0aee381dd56a8afc977ba0866b /clang/lib/Sema/SemaOverload.cpp | |
parent | 344b4d9f756592358fb4561d533b6e02092266c4 (diff) | |
download | bcm5719-llvm-2039ca061f07fc5fae7ced01ae7d428c3203db7b.tar.gz bcm5719-llvm-2039ca061f07fc5fae7ced01ae7d428c3203db7b.zip |
Two null Decl*'s don't refer to the same declaration, because they
don't refer to anything. Amusingly, we were relying on this in one
place. Thanks to Chandler for noticing the weirdness in
declaresSameEntity.
llvm-svn: 146659
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index d0d1484dd04..cf8df57eb3a 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -2262,7 +2262,7 @@ void Sema::HandleFunctionTypeMismatch(PartialDiagnostic &PDiag, } /// FunctionArgTypesAreEqual - This routine checks two function proto types -/// for equlity of their argument types. Caller has already checked that +/// for equality of their argument types. Caller has already checked that /// they have same number of arguments. This routine assumes that Objective-C /// pointer types which only differ in their protocol qualifiers are equal. /// If the parameters are different, ArgPos will have the the parameter index @@ -2300,8 +2300,9 @@ bool Sema::FunctionArgTypesAreEqual(const FunctionProtoType *OldType, ToType->getAs<ObjCObjectPointerType>()) { if (const ObjCObjectPointerType *PTFr = FromType->getAs<ObjCObjectPointerType>()) - if (declaresSameEntity(PTTo->getInterfaceDecl(), - PTFr->getInterfaceDecl())) + if (Context.hasSameUnqualifiedType( + PTTo->getObjectType()->getBaseType(), + PTFr->getObjectType()->getBaseType())) continue; } if (ArgPos) *ArgPos = O - OldType->arg_type_begin(); |