Commit 7c3001f4 by Paolo Carlini Committed by Paolo Carlini

re PR c++/59080 ([c++11] ICE with array of auto)

/cp
2013-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/59080
	* pt.c (unify): Don't call unify_array_domain with a NULL_TREE
	third argument.

	PR c++/59096
	* pt.c (apply_late_template_attributes): Check that TREE_VALUE
	isn't NULL_TREE in the attribute_takes_identifier_p case.

/testsuite
2013-11-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/59080
	* g++.dg/cpp0x/initlist75.C: New.

	PR c++/59096
	* g++.dg/cpp0x/gen-attrs-57.C: New.

From-SVN: r205344
parent d1d1af10
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59080
* pt.c (unify): Don't call unify_array_domain with a NULL_TREE
third argument.
PR c++/59096
* pt.c (apply_late_template_attributes): Check that TREE_VALUE
isn't NULL_TREE in the attribute_takes_identifier_p case.
2013-11-25 Adam Butcher <adam@jessamine.co.uk>
PR c++/59112
......
......@@ -8624,7 +8624,8 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
pass it through tsubst. Attributes like mode, format,
cleanup and several target specific attributes expect it
unmodified. */
else if (attribute_takes_identifier_p (get_attribute_name (t)))
else if (attribute_takes_identifier_p (get_attribute_name (t))
&& TREE_VALUE (t))
{
tree chain
= tsubst_expr (TREE_CHAIN (TREE_VALUE (t)), args, complain,
......@@ -17210,8 +17211,9 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
/* Also deduce from the length of the initializer list. */
tree max = size_int (CONSTRUCTOR_NELTS (arg));
tree idx = compute_array_index_type (NULL_TREE, max, tf_none);
return unify_array_domain (tparms, targs, TYPE_DOMAIN (parm),
idx, explain_p);
if (TYPE_DOMAIN (parm) != NULL_TREE)
return unify_array_domain (tparms, targs, TYPE_DOMAIN (parm),
idx, explain_p);
}
/* If the std::initializer_list<T> deduction worked, replace the
......
2013-11-25 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59080
* g++.dg/cpp0x/initlist75.C: New.
PR c++/59096
* g++.dg/cpp0x/gen-attrs-57.C: New.
2013-11-25 Adam Butcher <adam@jessamine.co.uk>
PR c++/59112
......
// PR c++/59096
// { dg-do compile { target c++11 } }
template<typename T> struct A
{
typedef T B [[mode]]; // { dg-warning "ignored" }
};
A<int>::B b;
// PR c++/59080
// { dg-require-effective-target c++11 }
#include <initializer_list>
auto foo[] = {}; // { dg-error "auto|unable to deduce" }
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