summaryrefslogtreecommitdiff
path: root/doc/const_cast.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-02-04 14:09:54 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-02-04 14:09:54 +0100
commitbd82d030011cd8b9655e5ded6b6df9343b42a6bd (patch)
treede82d886dfea0cb7dbb6e80436218a25cb211bc3 /doc/const_cast.c
Imported Upstream version 3.22upstream/3.22
Diffstat (limited to 'doc/const_cast.c')
-rw-r--r--doc/const_cast.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/const_cast.c b/doc/const_cast.c
new file mode 100644
index 0000000..0a7c070
--- /dev/null
+++ b/doc/const_cast.c
@@ -0,0 +1,12 @@
+/*
+ Fails to compile with gcc-4.7, 4.8 with the error message
+ "const_cast.c:5:13: error: dereferencing pointer to incomplete type".
+ But __typeof__(*f) is just a fancy way of writing "struct undisclosed"
+ and should be permitted. (Request for enhancement)
+*/
+struct undisclosed;
+int main(void) {
+ const struct undisclosed *f = 0;
+ __typeof__(*f) *g = 0;
+ return 0;
+}