aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index dea8389..1fb5a6a 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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;