aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-12-06 23:53:59 -0500
committerJason Merrill <jason@gcc.gnu.org>2012-12-06 23:53:59 -0500
commit3e243cfcede8e46b6d1a1548a1e6248df23bae3a (patch)
tree37937b4ff2b0e11b4a92113ab4ef5c076b935738 /gcc/cp/pt.c
parent01290963d131b098cc4b0f3f5d3401e976eb8d6e (diff)
downloadgcc-3e243cfcede8e46b6d1a1548a1e6248df23bae3a.zip
gcc-3e243cfcede8e46b6d1a1548a1e6248df23bae3a.tar.gz
gcc-3e243cfcede8e46b6d1a1548a1e6248df23bae3a.tar.bz2
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
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 87cd337..33044e0 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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