Commit 1c959721 by Jason Merrill Committed by Jason Merrill

re PR c++/55685 (ICE: canonical types differ for identical types)

	PR c++/55685
	* pt.c (tsubst_copy_and_build): Don't use SIZEOF_EXPR_TYPE_P in
	templates.

From-SVN: r194517
parent 71d1d77c
2012-12-14 Jason Merrill <jason@redhat.com>
PR c++/55685
* pt.c (tsubst_copy_and_build): Don't use SIZEOF_EXPR_TYPE_P in
templates.
PR c++/42315
* decl.c (maybe_deduce_size_from_array_init): Don't change the
variable type.
......
......@@ -13563,7 +13563,7 @@ tsubst_copy_and_build (tree t,
{
if (TREE_CODE (r) != SIZEOF_EXPR || TYPE_P (op1))
{
if (TYPE_P (op1))
if (!processing_template_decl && TYPE_P (op1))
{
r = build_min (SIZEOF_EXPR, size_type_node,
build1 (NOP_EXPR, op1, error_mark_node));
......
// PR c++/55685
typedef __SIZE_TYPE__ size_t;
template <size_t T, size_t U>
struct A;
template <typename T> struct B
{
static A <sizeof (T), 0> x;
};
template <typename T>
A <sizeof (T), 0> B <T>::x;
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