summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/offsetof.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-06-27 20:38:33 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-06-27 20:38:33 +0000
commit5e774b1333e9a0f1168274fbf1c4851bfc0f210a (patch)
treec3bd0ca69b985c8dc77e97bd3b98ba4cd6876bf8 /clang/test/Parser/offsetof.c
parent0799d916e1da65d9eebd0e05859b62039ef97316 (diff)
downloadbcm5719-llvm-5e774b1333e9a0f1168274fbf1c4851bfc0f210a.tar.gz
bcm5719-llvm-5e774b1333e9a0f1168274fbf1c4851bfc0f210a.zip
Fix the parser error hanlding for __builtin_offsetof to actually print
out an error for a malformed __builtin_offsetof. llvm-svn: 74388
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 00000000000..6c4e3feaa69
--- /dev/null
+++ b/clang/test/Parser/offsetof.c
@@ -0,0 +1,7 @@
+// RUN: clang-cc -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 '('}}
OpenPOWER on IntegriCloud