PR c++/55685
* pt.c (tsubst_copy_and_build): Don't use SIZEOF_EXPR_TYPE_P in
templates.
From-SVN: r194517
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.
{
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));
--- /dev/null
+// 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;