summaryrefslogtreecommitdiff
path: root/clang/test/Parser/offsetof.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Parser/offsetof.c')
-rw-r--r--clang/test/Parser/offsetof.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Parser/offsetof.c b/clang/test/Parser/offsetof.c
new file mode 100644
index 0000000..3a5b9f3
--- /dev/null
+++ b/clang/test/Parser/offsetof.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct a { struct { int b; } x[2]; };
+
+int a = __builtin_offsetof(struct a, x; // expected-error{{expected ')'}} expected-note{{to match this '('}}
+// FIXME: This actually shouldn't give an error
+int b = __builtin_offsetof(struct a, x->b); // expected-error{{expected ')'}} expected-note{{to match this '('}}