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
This commit is contained in:
parent
48b5158caa
commit
ea0e2a51f4
|
@ -1,5 +1,8 @@
|
|||
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);
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
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.
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// PR c++/12989
|
||||
|
||||
struct A
|
||||
{
|
||||
int foo() { return sizeof(bar); } // { dg-error "" }
|
||||
int bar();
|
||||
};
|
Loading…
Reference in New Issue