Commit 3e243cfc by Jason Merrill Committed by Jason Merrill

re PR c++/55058 (Unexpected invalid type conversion error)

	PR c++/55058
	* pt.c (tsubst): Keep the quals when looking through a typedef.

From-SVN: r194282
parent 01290963
2012-12-06 Jason Merrill <jason@redhat.com>
PR c++/55058
* pt.c (tsubst): Keep the quals when looking through a typedef.
PR c++/55249
* tree.c (build_vec_init_elt): Use the type of the initializer.
......
......@@ -11013,8 +11013,13 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
return r;
}
else
/* We don't have an instantiation yet, so drop the typedef. */
t = DECL_ORIGINAL_TYPE (decl);
{
/* We don't have an instantiation yet, so drop the typedef. */
int quals = cp_type_quals (t);
t = DECL_ORIGINAL_TYPE (decl);
t = cp_build_qualified_type_real (t, quals,
complain | tf_ignore_bad_quals);
}
}
if (type
......
// PR c++/55058
template <typename T>
struct A { };
template <typename T>
struct B {
B(const A<T> T::* p);
typedef A<T> D;
};
template <typename T>
B<T>::B(const D T::* p) { }
struct C {
C() : e() {};
const A<C> e;
};
B<C> g(&C::e);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment