aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-07-09 13:56:03 -0400
committerJason Merrill <jason@gcc.gnu.org>2013-07-09 13:56:03 -0400
commitcb5f47b639cda6c98d7def5e1f601e0cbc93da7d (patch)
tree657fe0a6b08a265f4bd077fb4cd2aff013459caa /gcc/cp
parent7eb48705c0b12d73651de15cd9a9a415c7229039 (diff)
downloadgcc-cb5f47b639cda6c98d7def5e1f601e0cbc93da7d.zip
gcc-cb5f47b639cda6c98d7def5e1f601e0cbc93da7d.tar.gz
gcc-cb5f47b639cda6c98d7def5e1f601e0cbc93da7d.tar.bz2
re PR c++/57545 (Generation of debug symbols leads to internal compiler error)
PR c++/57545 * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the argument to have the exact type of the parameter. From-SVN: r200841
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 87892aa..aab2844 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2013-07-09 Jason Merrill <jason@redhat.com>
+ PR c++/57545
+ * pt.c (convert_nontype_argument) [INTEGER_CST]: Force the
+ argument to have the exact type of the parameter.
+
PR c++/57551
* semantics.c (cxx_eval_indirect_ref): Don't try to look through
a POINTER_PLUS_EXPR for type punning diagnostic.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 23229a9..877d3b7 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -5620,6 +5620,10 @@ convert_nontype_argument (tree type, tree expr, tsubst_flags_t complain)
else
return NULL_TREE;
}
+
+ /* Avoid typedef problems. */
+ if (TREE_TYPE (expr) != type)
+ expr = fold_convert (type, expr);
}
/* [temp.arg.nontype]/5, bullet 2