+2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28294
+ * semantics.c (finish_offsetof): Use TREE_OPERAND for COMPONENT_REFs
+ only.
+
2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28343
|| TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE
|| TREE_CODE (TREE_TYPE (expr)) == UNKNOWN_TYPE)
{
- error ("cannot apply %<offsetof%> to member function %qD",
- TREE_OPERAND (expr, 1));
+ if (TREE_CODE (expr) == COMPONENT_REF)
+ expr = TREE_OPERAND (expr, 1);
+ error ("cannot apply %<offsetof%> to member function %qD", expr);
return error_mark_node;
}
return fold_offsetof (expr);
+2006-07-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/28294
+ * g++.dg/ext/offsetof1.C: Add test with function pointer arithmetic.
+
2006-07-14 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28343
int a = __builtin_offsetof(bar, foo); // { dg-error "static data member" }
int b = __builtin_offsetof(bar, baz); // { dg-error "member function" }
+int b0 = __builtin_offsetof(bar, baz[0]); // { dg-error "function" }
int c = __builtin_offsetof(bar, ~bar); // { dg-error "member function" }
typedef int I;