diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-08-18 21:25:30 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-08-18 21:25:30 +0000 |
| commit | fb640869ed14e5e3546fd88807d908258c0d4f9c (patch) | |
| tree | 36e01865a0351b47668f00eb64cdcd3e13c8456e /clang/lib/Sema | |
| parent | b37af7de47e5470a4d1416b2e08c80450d6125bc (diff) | |
| download | bcm5719-llvm-fb640869ed14e5e3546fd88807d908258c0d4f9c.tar.gz bcm5719-llvm-fb640869ed14e5e3546fd88807d908258c0d4f9c.zip | |
There is no pointer conversion between to similar types (i.e., same
type ignoring cv-qualifiers). These are qualification
conversions. Fixes PR7934.
llvm-svn: 111428
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 8a0732702b9..694975546cd 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/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). |

