aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-18 21:25:30 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-18 21:25:30 +0000
commit4e938f57bdd68b3716a4476acf151cdd27bb8a50 (patch)
tree1da91a63c0ae013890fa751719ae0cc650131341 /lib/Sema/SemaOverload.cpp
parent726578c22e9e33774435257664f8f6dc4cf8dfa9 (diff)
There is no pointer conversion between to similar types (i.e., same
type ignoring cv-qualifiers). These are qualification conversions. Fixes PR7934. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 8a0732702b..694975546c 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1406,6 +1406,11 @@ bool Sema::IsPointerConversion(Expr *From, QualType FromType, QualType ToType,
QualType FromPointeeType = FromTypePtr->getPointeeType();
+ // If the unqualified pointee types are the same, this can't be a
+ // pointer conversion, so don't do all of the work below.
+ if (Context.hasSameUnqualifiedType(FromPointeeType, ToPointeeType))
+ return false;
+
// An rvalue of type "pointer to cv T," where T is an object type,
// can be converted to an rvalue of type "pointer to cv void" (C++
// 4.10p2).