aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/offsetof1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/ext/offsetof1.C')
-rw-r--r--gcc/testsuite/g++.dg/ext/offsetof1.C3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/ext/offsetof1.C b/gcc/testsuite/g++.dg/ext/offsetof1.C
index 1468c0a7c06..23f3537c745 100644
--- a/gcc/testsuite/g++.dg/ext/offsetof1.C
+++ b/gcc/testsuite/g++.dg/ext/offsetof1.C
@@ -1,6 +1,7 @@
// PR c++/27601
// Origin: Patrik Hägglund <patrik.hagglund@bredband.net>
// { dg-do compile }
+// { dg-options "-Wno-pointer-arith" }
struct bar {
static int foo;
@@ -10,7 +11,7 @@ struct bar {
int a = __builtin_offsetof(bar, foo); // { dg-error "static data member" }
int av = __builtin_offsetof(volatile 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 b0 = __builtin_offsetof(bar, baz[0]); // { dg-error "single identifier nor|member function" }
int bv0 = __builtin_offsetof(volatile bar, baz[0]); // { dg-error "function" }
int c = __builtin_offsetof(bar, ~bar); // { dg-error "member function" }