diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-02 06:50:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-02 06:50:17 +0000 |
commit | 96b77fc05ed4a052a9e614f72b0e83572408ce48 (patch) | |
tree | 35ac356f0c87e5144e3b78ab1af299b1f48578f2 /test/Sema/declspec.c | |
parent | d9654557562e77564309f6b83b493a9a424e008a (diff) |
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
Diffstat (limited to 'test/Sema/declspec.c')
-rw-r--r-- | test/Sema/declspec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c index e262b343cb..36e54b25a7 100644 --- a/test/Sema/declspec.c +++ b/test/Sema/declspec.c @@ -13,4 +13,11 @@ static void buggy(int *x) { } // expected-error {{function definition declared ' // 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)}} |