Commit ea0e2a51 by Mark Mitchell Committed by Mark Mitchell

re PR c++/12989 ([new parser] internal compiler error: tree check: expected field_decl)

	PR c++/12989
	* typeck.c (cxx_sizeof_or_alignof_expr): Robustify.

	PR c++/12989
	* g++.dg/expr/sizeof1.C: New test.

From-SVN: r74660
parent 48b5158c
2003-12-15 Mark Mitchell <mark@codesourcery.com>
PR c++/12989
* typeck.c (cxx_sizeof_or_alignof_expr): Robustify.
PR c++/13310
* pt.c (dependent_template_p): Handle OVERLOADs.
......
......@@ -1233,6 +1233,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op)
}
if (TREE_CODE (e) == COMPONENT_REF
&& TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL
&& DECL_C_BIT_FIELD (TREE_OPERAND (e, 1)))
{
error ("invalid application of `%s' to a bit-field", op_name);
......
2003-12-15 Mark Mitchell <mark@codesourcery.com>
PR c++/12989
* g++.dg/expr/sizeof1.C: New test.
PR c++/13310
* g++.dg/template/crash15.C: New test.
......
// PR c++/12989
struct A
{
int foo() { return sizeof(bar); } // { dg-error "" }
int bar();
};
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