summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/conditional-expr.c2
-rw-r--r--clang/test/Sema/deref.c22
2 files changed, 23 insertions, 1 deletions
diff --git a/clang/test/Sema/conditional-expr.c b/clang/test/Sema/conditional-expr.c
index f6b9d1f42da..87fe2d2ed66 100644
--- a/clang/test/Sema/conditional-expr.c
+++ b/clang/test/Sema/conditional-expr.c
@@ -1,7 +1,7 @@
// RUN: clang -fsyntax-only -verify -pedantic %s
void foo() {
*(0 ? (double *)0 : (void *)0) = 0;
- *((void *) 0) = 0; // -expected-warning {{dereferencing void pointer}} -expected-error {{incomplete type 'void' is not assignable}}
+ *((void *) 0) = 0; // -expected-error {{incomplete type 'void' is not assignable}}
double *dp;
int *ip;
void *vp;
diff --git a/clang/test/Sema/deref.c b/clang/test/Sema/deref.c
new file mode 100644
index 00000000000..87f1b4862e5
--- /dev/null
+++ b/clang/test/Sema/deref.c
@@ -0,0 +1,22 @@
+// RUN: clang -fsyntax-only -verify -std=c90 %s
+void
+foo (void)
+{
+ struct b;
+ struct b* x = 0;
+ struct b* y = &*x;
+}
+
+void foo2 (void)
+{
+ typedef int (*arrayptr)[];
+ arrayptr x = 0;
+ arrayptr y = &*x;
+}
+
+void foo3 (void)
+{
+ void* x = 0;
+ void* y = &*x; // expected-error {{invalid lvalue in address expression}}
+}
+
OpenPOWER on IntegriCloud