Commit 79bb956e by Mark Mitchell Committed by Mark Mitchell

re PR c++/21025 (ICE on template)

	PR c++/21025
	* typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
	which sizeof/alignof is dependent, rather than just whether we are
	processing_template_decl.

	PR c++/21025
	* g++.dg/template/sizeof9.C: New test.

From-SVN: r98252
parent 2f358037
2005-04-16 Mark Mitchell <mark@codesourcery.com>
PR c++/21025
* typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
which sizeof/alignof is dependent, rather than just whether we are
processing_template_decl.
2005-04-17 Kazu Hirata <kazu@cs.umass.edu> 2005-04-17 Kazu Hirata <kazu@cs.umass.edu>
* cp-tree.h (LOOKUP_GLOBAL): Remove. * cp-tree.h (LOOKUP_GLOBAL): Remove.
......
...@@ -1221,7 +1221,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain) ...@@ -1221,7 +1221,7 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
if (type == error_mark_node) if (type == error_mark_node)
return error_mark_node; return error_mark_node;
if (processing_template_decl) if (dependent_type_p (type))
{ {
value = build_min (op, size_type_node, type); value = build_min (op, size_type_node, type);
TREE_READONLY (value) = 1; TREE_READONLY (value) = 1;
......
2005-04-16 Mark Mitchell <mark@codesourcery.com>
PR c++/21025
* typeck.c (cxx_sizeof_or_alignof_type): Check whether the type to
which sizeof/alignof is dependent, rather than just whether we are
processing_template_decl.
2005-04-15 Thomas Koenig <Thomas.Koenig@online.de> 2005-04-15 Thomas Koenig <Thomas.Koenig@online.de>
* gfortran.fortran-torture/execute/intrinsic_spread.f90: * gfortran.fortran-torture/execute/intrinsic_spread.f90:
......
// PR c++/21025
template<int N> struct X { char x[N]; };
template<typename T> X<1 + sizeof(T) - sizeof(T)> F(T const &);
template<int N> struct S { int d() { F(1); } };
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