Commit 887ab4e5 by Patrick Palka

Fix PR c++/62212 (ICE during mangling of array type)

gcc/cp/ChangeLog:

	PR c++/62212
	* tree.c (build_cplus_array_type): Determine type-dependentess
	with uses_template_parms instead of with dependent_type_p.

gcc/testsuite/ChangeLog:

	PR c++/62212
	* g++.dg/template/mangle2.C: New test.

From-SVN: r234457
parent fc3fb4ba
2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/62212
* tree.c (build_cplus_array_type): Determine type-dependentess
with uses_template_parms instead of with dependent_type_p.
2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/70347
......
......@@ -824,9 +824,8 @@ 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 && dependent_type_p (index_type))));
bool dependent = (uses_template_parms (elt_type)
|| (index_type && uses_template_parms (index_type)));
if (elt_type != TYPE_MAIN_VARIANT (elt_type))
/* Start with an array of the TYPE_MAIN_VARIANT. */
......
2016-03-24 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/62212
* g++.dg/template/mangle2.C: New test.
2016-03-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/70396
......
// PR c++/62212
// { dg-do assemble }
typedef int my_int;
template<typename T>
struct X {
enum {value = 1};
};
template<typename T>
void f(const my_int(&)[X<T>::value]);
int main() {
const my_int a[1] = {};
f<void>(a);
}
// { dg-final { scan-assembler "_Z1fIvEvRAsr1XIT_E5value_Ki" } }
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