Commit 545b7d8c by Volker Reichelt Committed by Volker Reichelt

re PR c++/27601 (ICE (in fold_offsetof_1, at c-common.c:5998) on strange offsetof)

	PR c++/27601
	* c-common.c (fold_offsetof_1): Handle static members.

	* g++.dg/ext/offsetof1.C: New test.

From-SVN: r114369
parent 0ac11108
2006-06-04 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27601
* c-common.c (fold_offsetof_1): Handle static members.
2006-06-04 Eric Christopher <echristo@apple.com>
* stor-layout.c (start_record_layout): Initialize remaining_in_alignment.
......
......@@ -5981,6 +5981,10 @@ fold_offsetof_1 (tree expr)
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-06-04 Eric Christopher <echristo@apple.com>
* gcc.dg/attr-ms_struct-1.c: New.
// PR c++/27601
// Origin: Patrik Hgglund <patrik.hagglund@bredband.net>
// { dg-do compile }
struct bar {
static int foo;
};
int a = __builtin_offsetof(bar, foo); // { dg-error "static data member" }
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