derived-to-base conversion on a pointer. Fixes PR7224.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104607
91177308-0d34-0410-b5e6-
96231b3b80d8
if (CanonToPointee.getLocalQualifiers() == Quals) {
// ToType is exactly what we need. Return it.
if (!ToType.isNull())
- return ToType;
+ return ToType.getUnqualifiedType();
// Build a pointer to ToPointee. It has the right qualifiers
// already.
void f(const X *);
void g(Y y) { f(y); }
}
+
+namespace PR7224 {
+ class A {};
+ class B : public A {};
+
+ int &foo(A *const d);
+ float &foo(const A *const d);
+
+ void bar()
+ {
+ B *const d = 0;
+ B const *const d2 = 0;
+ int &ir = foo(d);
+ float &fr = foo(d2);
+ }
+}