Add parsing and AST support for GNU "typeof".
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/typeof.c b/test/Parser/typeof.c
new file mode 100644
index 0000000..4829713
--- /dev/null
+++ b/test/Parser/typeof.c
@@ -0,0 +1,18 @@
+// RUN: clang -parse-ast-check %s -pedantic
+
+typedef int TInt;
+
+static void test() {
+ int *pi;
+
+ typeof(TInt) anInt; // expected-warning{{extension used}}
+ typeof(const int) aci; // expected-warning{{extension used}}
+ const typeof (*pi) aConstInt; // expected-warning{{extension used}}
+ int xx;
+ short typeof (*pi) aShortInt; // expected-error{{'short typeof' is invalid}}
+ int *i;
+ i = aci; // expected-warning{{incompatible types assigning 'typeof(int const)' to 'int *'}}
+ i = anInt; // expected-warning{{incompatible types assigning 'typeof(TInt)' to 'int *'}}
+ i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(<expr>) const' to 'int *'}}
+ i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}}
+}