PR c++/27601
* c-common.c (fold_offsetof_1): Handle static members.
* g++.dg/ext/offsetof1.C: New test.
From-SVN: r114371
+2006-06-04 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27601
+ * c-common.c (fold_offsetof_1): Handle static members.
+
2006-05-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27718
case ERROR_MARK:
return expr;
+ case VAR_DECL:
+ error ("cannot apply %<offsetof%> to static data member %qD", expr);
+ return error_mark_node;
+
case INDIRECT_REF:
return size_zero_node;
+2006-06-04 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27601
+ * g++.dg/ext/offsetof1.C: New test.
+
2006-05-30 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c/27718
--- /dev/null
+// PR c++/27601
+// Origin: Patrik Hägglund <patrik.hagglund@bredband.net>
+// { dg-do compile }
+
+struct bar {
+ static int foo;
+};
+
+int a = __builtin_offsetof(bar, foo); // { dg-error "static data member" }