Commit 397ad54d by Marek Polacek Committed by Marek Polacek

re PR c++/65390 (ICE in strip_typedefs, at cp/tree.c:1361)

	PR c++/65390
	* tree.c (build_cplus_array_type): Use dependent_type_p rather than
	checking for constness.

	* g++.dg/template/pr65390.C: New test.

From-SVN: r221799
parent 9e91e2cd
2015-03-31 Marek Polacek <polacek@redhat.com>
PR c++/65390
* tree.c (build_cplus_array_type): Use dependent_type_p rather than
checking for constness.
2015-03-30 Marek Polacek <polacek@redhat.com>
PR c++/65398
......
......@@ -822,10 +822,9 @@ build_cplus_array_type (tree elt_type, tree index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
bool dependent
= (processing_template_decl
&& (dependent_type_p (elt_type)
|| (index_type && !TREE_CONSTANT (TYPE_MAX_VALUE (index_type)))));
bool dependent = (processing_template_decl
&& (dependent_type_p (elt_type)
|| (index_type && dependent_type_p (index_type))));
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
/* Start with an array of the TYPE_MAIN_VARIANT. */
......
2015-03-31 Marek Polacek <polacek@redhat.com>
PR c++/65390
* g++.dg/template/pr65390.C: New test.
2015-03-31 Martin Liska <mliska@suse.cz>
* g++.dg/ipa/pr65557.C: New test.
......
// PR c++/65390
// { dg-do compile }
// { dg-options "" }
template<typename T> struct shared_ptr { };
template<typename T, typename Arg>
shared_ptr<T> make_shared(Arg) { return shared_ptr<T>(); } // { dg-error "variably modified type|trying to instantiate" }
void f(int n){
make_shared<int[n]>(1); // { dg-error "no matching function" }
}
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