1) Enforce C99 6.7.3p2: "Types other than pointer types derived from
object or incomplete types shall not be restrict-qualified."

2) Warn about qualifiers on function types: C99 6.7.3p8: "If the 
specification of a function type includes any type qualifiers, the 
behavior is undefined."

3) Implement restrict on C++ references.

4) fix some locations for various C++ reference diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49081 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c
index e262b34..36e54b2 100644
--- a/test/Sema/declspec.c
+++ b/test/Sema/declspec.c
@@ -13,4 +13,11 @@
                               // expected-error {{cannot combine with previous 'typedef' declaration specifier}} \
                               // expected-error {{cannot combine with previous 'struct' declaration specifier}}
 
+// Type qualifiers.
+typedef int f(void); 
+typedef f* fptr;
+const f* v1;         // expected-warning {{qualifier on function type 'f' has unspecified behavior}}
+__restrict__ f* v2;  // expected-error {{restrict requires a pointer or reference ('f' is invalid)}}
+__restrict__ fptr v3; // expected-error {{estrict pointee must be an object or incomplete type ('f' is invalid)}}
+f *__restrict__ v4;   // expected-error {{restrict pointee must be an object or incomplete type ('f' is invalid)}}